private void Application_ThreadException(object sender, ThreadExceptionEventArgs e) { // Log exception details before showing "error dialog" try { var submitter = new BugSubmitter(); var bugReport = submitter.CollectInfo(e.Exception); EventLog.WriteEntry("APClient", bugReport.GetUserFriendlyText(), EventLogEntryType.Error); } catch {} // Show error dialog. _BugReportPresenter.Show(e.Exception); }
public void Show(Exception ex) { try // Yes I know that it's not good practice // But still it the solution. { _BugReport = _BugSubmitter.CollectInfo(ex); } catch (Exception internalException) { MessageBox.Show("Error in exception-handling code. Please send us screenshot of this message\r\n" + BugSubmitter.FormatErrorMessage(internalException), "FileWall", MessageBoxButtons.OK, MessageBoxIcon.Error); } _FormBugReport.Details = _BugReport.GetUserFriendlyText(); _FormBugReport.ShowDialog(); }