1
0
mirror of https://github.com/chylex/TweetDuck.git synced 2025-05-07 08:34:06 +02:00

Add Reporter.HandleEarlyFailure for non-recoverable errors before Reporter is setup

This commit is contained in:
chylex 2016-09-27 17:58:13 +02:00
parent 61f6543041
commit 11f5f9b72e

View File

@ -70,5 +70,20 @@ public void HandleException(string caption, string message, bool canIgnore, Exce
Environment.FailFast(message, e);
}
}
public static void HandleEarlyFailure(string caption, string message){
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
FormMessage form = new FormMessage(caption, message, MessageBoxIcon.Error);
form.AddButton("Exit");
form.ShowDialog();
try{
Process.GetCurrentProcess().Kill();
}catch{
Environment.FailFast(message, new Exception(message));
}
}
}
}