mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
Modified UnhandleException handling
Since we're crashing at this point, calling the GUI's logging systems is moot. Just log to Utils.Log (which goes to file) before the crash happens
This commit is contained in:
parent
04f9775e96
commit
dcbf3b069f
@ -10,5 +10,16 @@ namespace Wabbajack
|
||||
/// </summary>
|
||||
public partial class App : Application
|
||||
{
|
||||
public App()
|
||||
{
|
||||
// Wire any unhandled crashing exceptions to log before exiting
|
||||
AppDomain.CurrentDomain.UnhandledException += (sender, e) =>
|
||||
{
|
||||
// Don't do any special logging side effects
|
||||
Utils.SetLoggerFn((s) => { });
|
||||
Utils.Log("Uncaught error:");
|
||||
Utils.Log(((Exception)e.ExceptionObject).ExceptionToString());
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
@ -26,7 +26,6 @@ namespace Wabbajack
|
||||
this._mwvm = new MainWindowVM(mode);
|
||||
var context = _mwvm.AppState;
|
||||
Utils.Log($"Wabbajack Build - {ThisAssembly.Git.Sha}");
|
||||
SetupHandlers();
|
||||
DataContext = _mwvm;
|
||||
|
||||
new Thread(() =>
|
||||
@ -68,17 +67,6 @@ namespace Wabbajack
|
||||
}).Start();
|
||||
}
|
||||
|
||||
private void SetupHandlers()
|
||||
{
|
||||
AppDomain.CurrentDomain.UnhandledException += AppHandler;
|
||||
}
|
||||
|
||||
private void AppHandler(object sender, UnhandledExceptionEventArgs e)
|
||||
{
|
||||
Utils.Log("Uncaught error:");
|
||||
Utils.Log(((Exception)e.ExceptionObject).ExceptionToString());
|
||||
}
|
||||
|
||||
internal bool ExitWhenClosing = true;
|
||||
|
||||
private void Window_Closing(object sender, CancelEventArgs e)
|
||||
|
Loading…
Reference in New Issue
Block a user