public override void AfterCreated(ExceptionlessPluginContext context, Error error, Exception exception) { if (!context.Data.ContainsKey("HttpActionContext")) return; base.AfterCreated(context, error, exception); error.ExceptionlessClientInfo.Platform = ".NET WebApi"; }
public override void AfterCreated(ExceptionlessPluginContext context, Error error, Exception exception) { base.AfterCreated(context, error, exception); HttpContextBase httpContext = context.Data.GetHttpContext(); // if the context is not passed in, try and grab it if (httpContext == null && HttpContext.Current != null) httpContext = new HttpContextWrapper(HttpContext.Current); if (httpContext == null) return; error.ExceptionlessClientInfo.Platform = ".NET Web"; var httpException = exception as HttpException; if (httpException != null) { int httpCode = httpException.GetHttpCode(); error.Code = httpCode.ToString(); // only record the bare minimum information on 404s. if (error.Code == "404") { error.StackTrace.Clear(); error.Inner = null; error.TargetMethod = null; } } var tags = httpContext.Items[TAGS_HTTP_CONTEXT_NAME] as TagSet; if (tags != null) error.Tags.UnionWith(tags); }
public override void AfterCreated(ExceptionlessPluginContext context, Error error, Exception exception) { base.AfterCreated(context, error, exception); if (context.Data.GetHttpContext() == null) return; error.ExceptionlessClientInfo.Platform = ".NET MVC"; }
public override bool ShowUnhandledErrorSubmissionUI(ExceptionlessPluginContext context, Error error) { if (!_showDialog) return true; bool shouldSend; if (Application.Current != null && !Application.Current.Dispatcher.CheckAccess()) shouldSend = (bool)Application.Current.Dispatcher.Invoke(new Func<Error, bool>(ShowDialog), DispatcherPriority.Send, error); else shouldSend = ShowDialog(error); return shouldSend; }
public override void AddDefaultInformation(ExceptionlessPluginContext context, Error error) { base.AddDefaultInformation(context, error); NancyContext nancyContext = context.Data.GetNancyContext(); if (nancyContext == null) return; try { error.AddRequestInfo(nancyContext); if (nancyContext.CurrentUser != null && context.Client.Configuration.IncludePrivateInformation) error.UserName = nancyContext.CurrentUser.UserName; } catch (Exception ex) { context.Client.Log.Error(typeof(ExceptionlessNancyPlugin), ex, "Error adding request info."); } }
public override void AddDefaultInformation(ExceptionlessPluginContext context, Error error) { if (!context.Data.ContainsKey("HttpActionContext")) return; base.AddDefaultInformation(context, error); HttpActionContext actionContext = context.Data.GetHttpActionContext(); if (actionContext == null) return; IPrincipal principal = GetPrincipal(actionContext.Request); if (context.Client.Configuration.IncludePrivateInformation && principal != null && principal.Identity.IsAuthenticated) error.UserName = principal.Identity.Name; try { error.AddHttpRequestInfo(actionContext); } catch (Exception ex) { context.Client.Log.Error(typeof(ExceptionlessWebApiPlugin), ex, "Error adding request info."); } }
public override void AddDefaultInformation(ExceptionlessPluginContext context, Error error) { base.AddDefaultInformation(context, error); error.UserName = null; HttpContextBase httpContext = context.Data.GetHttpContext(); // if the context is not passed in, try and grab it if (httpContext == null && HttpContext.Current != null) httpContext = new HttpContextWrapper(HttpContext.Current); if (httpContext == null) return; if (context.Client.Configuration.IncludePrivateInformation && httpContext.User != null && httpContext.User.Identity.IsAuthenticated) error.UserName = httpContext.User.Identity.Name; try { error.AddRequestInfo(context.Client, httpContext); } catch (Exception ex) { context.Client.Log.Error(typeof(ExceptionlessWebPlugin), ex, "Error adding request info."); } }
internal static Error ToError(ExceptionlessClient client, Exception exception, string submissionMethod = "Manual", IDictionary<string, object> contextData = null) { Error error = exception.ToErrorModel(); error.Id = ObjectId.GenerateNewId().ToString(); error.OccurrenceDate = DateTimeOffset.Now; error.ExceptionlessClientInfo = ExceptionlessClientInfoCollector.Collect(client, client.Configuration.IncludePrivateInformation); error.ExceptionlessClientInfo.SubmissionMethod = submissionMethod; foreach (IExceptionlessPlugin plugin in client.Plugins) { try { var ctx = new ExceptionlessPluginContext(client, contextData); plugin.AfterCreated(ctx, error, exception); } catch (Exception ex) { client.Log.FormattedError(typeof(ErrorExtensions), ex, "Error creating error model information: {0}", ex.Message); } } return error; }
public override void AfterCreated(ExceptionlessPluginContext context, Error error, Exception exception) { base.AfterCreated(context, error, exception); error.ExceptionlessClientInfo.Platform = ".NET WPF"; }
public override bool ShowUnhandledErrorSubmissionUI(ExceptionlessPluginContext context, Error error) { if (!_showDialog) return true; return ShowDialog(error); }
public virtual bool ShowUnhandledErrorSubmissionUI(ExceptionlessPluginContext context, Error error) { return(true); }
public virtual void AddDefaultInformation(ExceptionlessPluginContext context, Error error) { }
public virtual void AfterCreated(ExceptionlessPluginContext context, Error error, Exception exception) { }
public virtual bool ShowUnhandledErrorSubmissionUI(ExceptionlessPluginContext context, Error error) { return true; }
public virtual void AddDefaultInformation(ExceptionlessPluginContext context, Error error) {}
public virtual void AfterCreated(ExceptionlessPluginContext context, Error error, Exception exception) {}