static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) { if (primaryForm != null) { Exception ex = (Exception)e.ExceptionObject; string log = "Texture Editor: New log entry on " + DateTime.Now.ToString("G") + System.Environment.NewLine + "Build date:" + File.GetLastWriteTimeUtc(Application.ExecutablePath).ToString(System.Globalization.CultureInfo.InvariantCulture) + System.Environment.NewLine + ex.ToString(); string errDesc = "Texture Editor has crashed with the following error:\n" + ex.GetType().Name + ".\n\n" + "If you wish to report a bug, please include the following in your report:"; SonicRetro.SAModel.SAEditorCommon.ErrorDialog report = new SonicRetro.SAModel.SAEditorCommon.ErrorDialog("Texture Editor", errDesc, log); DialogResult dgresult = report.ShowDialog(primaryForm); switch (dgresult) { case DialogResult.Abort: case DialogResult.OK: Application.Exit(); break; } } else { string logPath = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) + "\\TextureEditor.log"; System.IO.File.WriteAllText(logPath, e.ExceptionObject.ToString()); MessageBox.Show("Unhandled Exception " + e.ExceptionObject.GetType().Name + "\nLog file has been saved to:\n" + logPath + ".", "Texture Editor Fatal Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void bugReportToolStripMenuItem_Click(object sender, EventArgs e) { string errDesc = "You can submit a new issue on SA Tools GitHub issue tracker.\n\nPlease make sure the problem is reproducible on the latest version of SA Tools.\n\nIf you wish to report a bug, please include the following in your report:"; SonicRetro.SAModel.SAEditorCommon.ErrorDialog report = new SonicRetro.SAModel.SAEditorCommon.ErrorDialog("SADXTweaker2", errDesc, null); DialogResult dgresult = report.ShowDialog(); switch (dgresult) { case DialogResult.Abort: case DialogResult.OK: Application.Exit(); break; } }
void Application_ThreadException(object sender, System.Threading.ThreadExceptionEventArgs e) { string errDesc = "SADXTweaker2 has crashed with the following error:\n" + e.Exception.GetType().Name + ".\n\n" + "If you wish to report a bug, please include the following in your report:"; SonicRetro.SAModel.SAEditorCommon.ErrorDialog report = new SonicRetro.SAModel.SAEditorCommon.ErrorDialog("SADXTweaker2", errDesc, e.Exception.ToString()); DialogResult dgresult = report.ShowDialog(); switch (dgresult) { case DialogResult.Abort: case DialogResult.OK: Application.Exit(); break; } }
static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) { if (FormInstance != null) { Exception ex = (Exception)e.ExceptionObject; string errDesc = "SADXTweaker2 has crashed with the following error:\n" + ex.GetType().Name + ".\n\n" + "If you wish to report a bug, please include the following in your report:"; SonicRetro.SAModel.SAEditorCommon.ErrorDialog report = new SonicRetro.SAModel.SAEditorCommon.ErrorDialog("SADXTweaker2", errDesc, ex.ToString()); DialogResult dgresult = report.ShowDialog(FormInstance); switch (dgresult) { case DialogResult.Abort: case DialogResult.OK: Application.Exit(); break; } } else { System.IO.File.WriteAllText("SADXTweaker2.log", e.ExceptionObject.ToString()); MessageBox.Show("Unhandled Exception " + e.ExceptionObject.GetType().Name + "\nLog file has been saved.", "SADXTweaker2 Fatal Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) { if (primaryForm != null) { Exception ex = (Exception)e.ExceptionObject; string errDesc = "DLC Tool has crashed with the following error:\n" + ex.GetType().Name + ".\n\n" + "If you wish to report a bug, please include the following in your report:"; SonicRetro.SAModel.SAEditorCommon.ErrorDialog report = new SonicRetro.SAModel.SAEditorCommon.ErrorDialog("DLC Tool", errDesc, ex.ToString()); DialogResult dgresult = report.ShowDialog(primaryForm); switch (dgresult) { case DialogResult.Abort: case DialogResult.OK: Application.Exit(); break; } } else { string logPath = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) + "\\DLCTool.log"; System.IO.File.WriteAllText(logPath, e.ExceptionObject.ToString()); MessageBox.Show("Unhandled Exception " + e.ExceptionObject.GetType().Name + "\nLog file has been saved to:\n" + logPath + ".", "DLC Tool Fatal Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }