/// <summary> /// Raises the <see cref="UnhandledExceptionReporting" /> event. /// </summary> /// <param name="e">The <see cref="UnhandledExceptionReportingEventArgs" /> instance containing the event data.</param> protected void OnUnhandledExceptionReporting(UnhandledExceptionReportingEventArgs e) { if (UnhandledExceptionReporting != null) { UnhandledExceptionReporting(this, e); } }
/// <summary> /// Process an unhandled exception. /// </summary> /// <param name="ex">The exception</param> /// <param name="submissionMethod">The method that was used to collect the error.</param> /// <param name="includeDefaultInformation">Whether to add the default information to the case or not</param> /// <param name="contextData">Any additional contextual data that should be used during creation of the error information.</param> public void ProcessUnhandledException(Exception ex, string submissionMethod, bool includeDefaultInformation = true, IDictionary <string, object> contextData = null) { Error error = CreateError(ex, addDefaultInformation: includeDefaultInformation, submissionMethod: submissionMethod, contextData: contextData); Log.FormattedInfo(typeof(ExceptionlessClient), "Processing unhandled exception of type '{0}'...", ex.GetType().FullName); var args = new UnhandledExceptionReportingEventArgs(ex, error); OnUnhandledExceptionReporting(args); if (args.Cancel) { return; } if (args.ShouldShowUI) { IExceptionlessPlugin uiPlugin = Plugins.FirstOrDefault(p => p.SupportsShowingUnhandledErrorSubmissionUI); if (uiPlugin != null) { if (!uiPlugin.ShowUnhandledErrorSubmissionUI(new ExceptionlessPluginContext(this, contextData), error)) { return; } } } SubmitError(error); }
private static void UnhandledExceptionReporting(object sender, UnhandledExceptionReportingEventArgs e) { var dialog = new CrashReportForm(e.Error); DialogResult result = dialog.ShowDialog(); e.Cancel = result == DialogResult.Cancel; }
/// <summary> /// Raises the <see cref="UnhandledExceptionReporting" /> event. /// </summary> /// <param name="e">The <see cref="UnhandledExceptionReportingEventArgs" /> instance containing the event data.</param> protected void OnUnhandledExceptionReporting(UnhandledExceptionReportingEventArgs e) { if (UnhandledExceptionReporting != null) UnhandledExceptionReporting(this, e); }
/// <summary> /// Process an unhandled exception. /// </summary> /// <param name="ex">The exception</param> /// <param name="submissionMethod">The method that was used to collect the error.</param> /// <param name="includeDefaultInformation">Whether to add the default information to the case or not</param> /// <param name="contextData">Any additional contextual data that should be used during creation of the error information.</param> public void ProcessUnhandledException(Exception ex, string submissionMethod, bool includeDefaultInformation = true, IDictionary<string, object> contextData = null) { Error error = CreateError(ex, addDefaultInformation: includeDefaultInformation, submissionMethod: submissionMethod, contextData: contextData); Log.FormattedInfo(typeof(ExceptionlessClient), "Processing unhandled exception of type '{0}'...", ex.GetType().FullName); var args = new UnhandledExceptionReportingEventArgs(ex, error); OnUnhandledExceptionReporting(args); if (args.Cancel) return; if (args.ShouldShowUI) { IExceptionlessPlugin uiPlugin = Plugins.FirstOrDefault(p => p.SupportsShowingUnhandledErrorSubmissionUI); if (uiPlugin != null) { if (!uiPlugin.ShowUnhandledErrorSubmissionUI(new ExceptionlessPluginContext(this, contextData), error)) return; } } SubmitError(error); }