Beispiel #1
0
 public Event(string payloadVersion, App app, Device device, System.Exception exception, HandledState handledState, IEnumerable <Breadcrumb> breadcrumbs, Session session)
 {
     this.AddToPayload("payloadVersion", payloadVersion);
     this.AddToPayload("exceptions", new Exceptions(exception, 5).ToArray());
     this.AddToPayload("app", app);
     this.AddToPayload("device", device);
     this.AddToPayload("metaData", new Metadata());
     this.AddToPayload("breadcrumbs", breadcrumbs);
     this.AddToPayload("session", session);
     HandledState = handledState;
 }
Beispiel #2
0
        /// <summary>
        /// Represents an error report that can be sent to the Bugsnag error notification endpoint.
        /// </summary>
        /// <param name="configuration"></param>
        /// <param name="exception"></param>
        /// <param name="severity"></param>
        /// <param name="breadcrumbs"></param>
        /// <param name="session"></param>
        public Report(IConfiguration configuration, System.Exception exception, HandledState severity, Breadcrumb[] breadcrumbs, Session session)
        {
            _ignored = false;
            Endpoint = configuration.Endpoint;
            Proxy    = configuration.Proxy;
            _headers = new KeyValuePair <string, string>[] {
                new KeyValuePair <string, string>(Payload.Headers.ApiKeyHeader, configuration.ApiKey),
                new KeyValuePair <string, string>(Payload.Headers.PayloadVersionHeader, _payloadVersion),
            };

            _configuration     = configuration;
            _originalException = exception;
            _originalSeverity  = severity;

            this.AddToPayload("apiKey", configuration.ApiKey);
            this.AddToPayload("notifier", NotifierInfo.Instance);

            var app    = new App(configuration);
            var device = new Device();

            _event = new Event(_payloadVersion, app, device, exception, severity, breadcrumbs, session);

            this.AddToPayload("events", new[] { _event });
        }
Beispiel #3
0
 /// <summary>
 /// Creates a HandledState object for an error report payload where the severity for the exception was modified
 /// while running the middleware/callback.
 /// </summary>
 /// <param name="severity"></param>
 /// <param name="previousSeverity"></param>
 /// <returns></returns>
 public static HandledState ForCallbackSpecifiedSeverity(Bugsnag.Severity severity, HandledState previousSeverity)
 {
     return(new HandledState(previousSeverity.Handled, severity, SeverityReason.ForCallbackSpecifiedSeverity()));
 }
 public ReportContext(System.Exception exception, HandledState severity)
 {
     this.AddToPayload("bugsnag.original.exception", exception);
     this.AddToPayload("bugsnag.original.severity", severity);
 }