private static void HandleTopLevelError(object sender, ThreadExceptionEventArgs eventArgs)
{
if (BasicUtils.IsUnsupportedCultureException(eventArgs.Exception)) // LT-8248
{
Logger.WriteEvent("Unsupported culture: " + eventArgs.Exception.Message);
return;
}
// If we can't recover the connection, we want to 'handle' it at this high level by exiting without
// displaying a message.
if (eventArgs.Exception is NonRecoverableConnectionLostException || DisplayError(eventArgs.Exception, false))
{
FwApp.InCrashedState = true;
Application.Exit();
// just to be sure
Thread.Sleep(5000); // 5s
using (var process = Process.GetCurrentProcess())
process.Kill();
}
}