/// <summary> /// Shows the error report. /// </summary> /// <param name="message">Message to display with error.</param> /// <param name="ex">The exception.</param> protected void ShowErrorReport(string message, Exception ex) { ExceptionReporter reporter = new ExceptionReporter(); reporter.ReadConfig(); reporter.Config.TitleText = "Oberon Crash Reporter"; reporter.Show(message, ex); }
private static void HandleException(Exception e) { if (CurrentProject != null) { if (!Directory.Exists("recovery")) Directory.CreateDirectory("recovery"); string filePath = "recovery/" + (CurrentProject.Name ?? "project.tlpx"); using (FileStream fstr = File.OpenWrite(filePath)) { CurrentProject.Save(fstr, new FileProjectResolver(filePath)); } } ExceptionReporter reporter = new ExceptionReporter(); reporter.Config.ShowSysInfoTab = false; reporter.Config.ShowConfigTab = false; reporter.Config.EmailReportAddress = "*****@*****.**"; reporter.Config.TitleText = "Treefrog Crash"; reporter.Config.UserExplanationLabel = "Enter a brief description leading up to the crash. Your project has been saved to /recovery."; reporter.Show(e); Application.Exit(); }
private static void ThreadException(object sender, ThreadExceptionEventArgs e) { log.Fatal("Unhandled thread exception.", e.Exception); FlushLogBuffers(); Properties.Settings.Default.Crashed = true; Properties.Settings.Default.Save(); ExceptionReporter reporter = new ExceptionReporter(); reporter.Show(e.Exception); }
private static void UnhandledException(object sender, UnhandledExceptionEventArgs e) { log.Fatal("Unhandled exception to toplevel.", (Exception)e.ExceptionObject); FlushLogBuffers(); Properties.Settings.Default.Crashed = true; Properties.Settings.Default.Save(); ExceptionReporter reporter = new ExceptionReporter(); reporter.Show((Exception)e.ExceptionObject); }
/// <summary> /// Handles the UnhandledException event of the Application control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.Windows.Threading.DispatcherUnhandledExceptionEventArgs"/> instance containing the event data.</param> private void Application_UnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e) { if (System.Diagnostics.Debugger.IsAttached) { // an unhandled exception has occurred; break into the debugger System.Diagnostics.Debugger.Break(); } ExceptionReporter reporter = new ExceptionReporter(); reporter.ReadConfig(); reporter.Config.TitleText = "Oberon Crash Report"; reporter.Show(e.Exception); e.Handled = true; // handle the exception so we don't crash }
static void currentDomainUnhandledException(object sender, UnhandledExceptionEventArgs e) { var exception = e.ExceptionObject as Exception; var log = LogManager.GetLogger("Sfera"); log.ErrorFormat("Errore inaspettato - {0}", e.ExceptionObject as Exception, Utility.GetMethodDescription()); if (exception != null) { var reporter = new ExceptionReporter(); reporter.ReadConfig(); // optionally, read properties from the application's config file reporter.Config.ShowFlatButtons = true; // this particular config is code-only reporter.Show(exception); } }
public void ApplicationThreadException(object sender, ThreadExceptionEventArgs e) { ExceptionReporter reporter = new ExceptionReporter(); reporter.Show(e.Exception); }
static void applicationUnhandledException(object sender, ThreadExceptionEventArgs e) { var log = LogManager.GetLogger("Sfera"); if (e.Exception != null) { log.ErrorFormat("Errore inaspettato - {0} - azienda:{1}", e.Exception, Utility.GetMethodDescription(), Login.Instance.CurrentLogin().Azienda); if (e.Exception.InnerException != null) log.ErrorFormat("Errore inaspettato - INNER EXCEPTION - {0} - azienda:{1}", e.Exception.InnerException, Utility.GetMethodDescription(), Login.Instance.CurrentLogin().Azienda); } try { var reporter = new ExceptionReporter(); reporter.ReadConfig(); // optionally, read properties from the application's config file reporter.Config.ShowFlatButtons = true; // this particular config is code-only reporter.Show(e.Exception); } catch (Exception ex) { log.ErrorFormat("Errore inaspettato nella visualizzazione della maschera di errore gestito - {0} - azienda:{1}", ex, Utility.GetMethodDescription(), Login.Instance.CurrentLogin().Azienda); } }