Catch all unhandled Exceptions
This commit is contained in:
parent
51aa2bf89c
commit
3c54482248
|
@ -68,6 +68,8 @@ namespace SparkleShare {
|
|||
}
|
||||
|
||||
try {
|
||||
AppDomain.CurrentDomain.UnhandledException += OnUnhandledException;
|
||||
|
||||
Controller = new SparkleController ();
|
||||
Controller.Initialize ();
|
||||
|
||||
|
@ -85,5 +87,18 @@ namespace SparkleShare {
|
|||
GC.WaitForPendingFinalizers ();
|
||||
#endif
|
||||
}
|
||||
|
||||
static void OnUnhandledException(object sender, UnhandledExceptionEventArgs exceptionArgs)
|
||||
{
|
||||
try
|
||||
{
|
||||
var e = (Exception)exceptionArgs.ExceptionObject;
|
||||
SparkleLogger.WriteCrashReport(e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
Environment.Exit (-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue