public GadgetSpec getGadgetSpec(URI gadgetUri, bool ignoreCache) { Uri uri = Uri.fromJavaUri(gadgetUri); if (ignoreCache) { return(FetchObjectAndCache(uri, ignoreCache)); } GadgetSpec cached = HttpRuntime.Cache[gadgetUri.ToString()] as GadgetSpec; GadgetSpec spec; if (cached == null) { try { spec = FetchObjectAndCache(uri, ignoreCache); } catch (GadgetException e) { // We create this dummy spec to avoid the cost of re-parsing when a remote site is out. spec = new GadgetSpec(uri, ERROR_SPEC); spec.setAttribute(ERROR_KEY, e); HttpRuntime.Cache.Insert(uri.ToString(), spec, null, System.Web.Caching.Cache.NoAbsoluteExpiration, TimeSpan.FromSeconds(ERROR_DELAY)); } } else { spec = cached; } GadgetException exception = (GadgetException)spec.getAttribute(ERROR_KEY); if (exception != null) { throw exception; } return(spec); }
public GadgetException(GadgetException.Code code) { this.code = code; }
public GadgetException(GadgetException.Code code, String msg, Exception cause) : base(msg, cause) { this.code = code; }
public GadgetException(GadgetException.Code code, String msg) : base(msg) { this.code = code; }
public GadgetException(GadgetException.Code code, Exception cause) : base(cause.Message, cause) { this.code = code; }