added logging of unhandled exceptions in DEBUG build.

This commit is contained in:
morkt 2015-08-03 22:25:13 +04:00
parent 63bb1995ef
commit a9375e777e

View File

@ -67,6 +67,12 @@ namespace GARbro.GUI
Trace.AutoFlush = true; Trace.AutoFlush = true;
#endif #endif
Trace.WriteLine ("ApplicationStartup --------------------------------", "GARbro.GUI.App"); Trace.WriteLine ("ApplicationStartup --------------------------------", "GARbro.GUI.App");
this.DispatcherUnhandledException += (s, args) =>
{
Trace.WriteLine (string.Format ("Unhandled exception caught: {1}", args.Exception.Message),
"GARbro.GUI.App");
Trace.WriteLine (args.Exception.StackTrace, "Stack trace");
};
try try
{ {
if (0 != e.Args.Length) if (0 != e.Args.Length)
@ -85,7 +91,7 @@ namespace GARbro.GUI
if (string.IsNullOrEmpty (InitPath)) if (string.IsNullOrEmpty (InitPath))
InitPath = Directory.GetCurrentDirectory(); InitPath = Directory.GetCurrentDirectory();
CurrentPath = ""; CurrentPath = "";
} }
void ApplicationExit (object sender, ExitEventArgs e) void ApplicationExit (object sender, ExitEventArgs e)