mirror of
https://github.com/chylex/TweetDuck.git
synced 2025-08-14 21:16:58 +02:00
Add Reporter.HandleEarlyFailure for non-recoverable errors before Reporter is setup
This commit is contained in:
15
Reporter.cs
15
Reporter.cs
@@ -70,5 +70,20 @@ namespace TweetDck{
|
|||||||
Environment.FailFast(message, e);
|
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));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user