This commit is contained in:
JustArchi
2017-06-15 20:27:57 +02:00
parent 5b0aa72367
commit b3c9fa3853
2 changed files with 18 additions and 14 deletions

View File

@@ -248,19 +248,21 @@ namespace ArchiSteamFarm {
}
ASF.ArchiLogger.LogFatalException((Exception) args.ExceptionObject);
await Task.Delay(5000).ConfigureAwait(false);
await Task.Delay(1000).ConfigureAwait(false); // For writing stuff to logs
await Exit(1).ConfigureAwait(false);
}
private static void UnobservedTaskExceptionHandler(object sender, UnobservedTaskExceptionEventArgs args) {
if (args?.Exception == null) {
ASF.ArchiLogger.LogNullError(nameof(args) + " || " + nameof(args.Exception));
private static void UnobservedTaskExceptionHandler(object sender, UnobservedTaskExceptionEventArgs e) {
if (e?.Exception == null) {
ASF.ArchiLogger.LogNullError(nameof(e) + " || " + nameof(e.Exception));
return;
}
ASF.ArchiLogger.LogFatalException(args.Exception);
ASF.ArchiLogger.LogFatalException(e.Exception);
// Normally we should abort the application here, but many tasks are in fact failing in SK2 code which we can't easily fix
// Thanks Valve.
e.SetObserved();
}
}
}