Add a default exception handler. The default Windows one doesn't always show a message properly.
This commit is contained in:
parent
78d6be9341
commit
d7f94fa99f
@ -13,11 +13,19 @@ namespace smx_config
|
|||||||
|
|
||||||
App()
|
App()
|
||||||
{
|
{
|
||||||
|
AppDomain.CurrentDomain.UnhandledException += UnhandledExceptionEventHandler;
|
||||||
|
|
||||||
if(Helpers.GetDebug())
|
if(Helpers.GetDebug())
|
||||||
SMX_Internal_OpenConsole();
|
SMX_Internal_OpenConsole();
|
||||||
CurrentSMXDevice.singleton = new CurrentSMXDevice();
|
CurrentSMXDevice.singleton = new CurrentSMXDevice();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void UnhandledExceptionEventHandler(object sender, UnhandledExceptionEventArgs e)
|
||||||
|
{
|
||||||
|
string message = e.ExceptionObject.ToString();
|
||||||
|
MessageBox.Show("SMXConfig encountered an unexpected error:\n\n" + message, "SMXConfig");
|
||||||
|
}
|
||||||
|
|
||||||
protected override void OnExit(ExitEventArgs e)
|
protected override void OnExit(ExitEventArgs e)
|
||||||
{
|
{
|
||||||
base.OnExit(e);
|
base.OnExit(e);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user