Baconit.App.OnUnhandledException C# (CSharp) Method

OnUnhandledException() private method

Fired when an exception is thrown.
private OnUnhandledException ( object sender, UnhandledExceptionEventArgs e ) : void
sender object
e UnhandledExceptionEventArgs
return void
        private void OnUnhandledException(object sender, UnhandledExceptionEventArgs e)
        {
            if (Debugger.IsAttached)
            {
                Debugger.Break();
            }

            if (App.BaconMan.UiSettingsMan.Developer_StopFatalCrashesAndReport)
            {
                // Warning this will report the error but leave us in a very bad state. Only use this for debugging.
                e.Handled = true;
                BaconMan.MessageMan.ShowMessageSimple("Fatal Crash", "The app tried to crash. \n\nMessage: " + e.Message + "\n\nException Msg: " + e.Exception.Message + "\n\nStack Trace:\n"+e.Exception.StackTrace);
            }
        }
    }