mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-22 11:12:36 +01:00
Include version in crash msgbox
This commit is contained in:
parent
ce1473210d
commit
21a81f48f9
@ -41,7 +41,7 @@ namespace Nikse.SubtitleEdit
|
||||
try
|
||||
{
|
||||
var cap = "Windows Forms Thread Exception";
|
||||
var msg = "An application error occurred in Subtitle Edit." +
|
||||
var msg = "An application error occurred in Subtitle Edit " + GetVersion() + ". " +
|
||||
"\nPlease report at https://github.com/SubtitleEdit/subtitleedit/issues with the following information:" +
|
||||
"\n\nError Message:\n" + exc.Message +
|
||||
"\n\nStack Trace:\n" + exc.StackTrace;
|
||||
@ -57,6 +57,18 @@ namespace Nikse.SubtitleEdit
|
||||
}
|
||||
}
|
||||
|
||||
private static string GetVersion()
|
||||
{
|
||||
try
|
||||
{
|
||||
return System.Reflection.Assembly.GetEntryAssembly().GetName().Version.ToString();
|
||||
}
|
||||
catch
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
// Handle the non-UI exceptions by logging the event to the ThreadException event log before
|
||||
// the system default handler reports the exception to the user and terminates the application.
|
||||
// NOTE: This exception handler cannot prevent the termination of the application.
|
||||
@ -65,7 +77,7 @@ namespace Nikse.SubtitleEdit
|
||||
try
|
||||
{
|
||||
var exc = e.ExceptionObject as Exception;
|
||||
var msg = "A fatal non-UI error occurred in Subtitle Edit." +
|
||||
var msg = "A fatal non-UI error occurred in Subtitle Edit " + GetVersion() + "." +
|
||||
"\nPlease report at https://github.com/SubtitleEdit/subtitleedit/issues with the following information:" +
|
||||
"\n\nError Message:\n" + exc.Message +
|
||||
"\n\nStack Trace:\n" + exc.StackTrace;
|
||||
@ -87,7 +99,7 @@ namespace Nikse.SubtitleEdit
|
||||
try
|
||||
{
|
||||
var cap = "Non-UI Thread Exception";
|
||||
var msg = "A fatal non-UI error occurred in Subtitle Edit." +
|
||||
var msg = "A fatal non-UI error occurred in Subtitle Edit " + GetVersion() + "." +
|
||||
"\nCould not write the error to the event log." +
|
||||
"\nReason: " + ex.Message;
|
||||
MessageBox.Show(msg, cap, MessageBoxButtons.OK, MessageBoxIcon.Stop);
|
||||
|
Loading…
Reference in New Issue
Block a user