public static bool IsNotFatal(this Exception e) { Exception exception = e; Type exceptionType = e.GetType(); if (FatalTypes.Contains(exceptionType)) { StackTrace stackTrace = new StackTrace(1, true); string stackTraceText = stackTrace.ToString(); string message = $"Exception type is fatal: {exceptionType}, {e}\n at \n{stackTraceText}"; FatalException?.Invoke(null, new FatalExceptionEventArgs(message, exception)); return(false); } return(true); }
private static void LogFailedTask(Task task) { FatalException?.Invoke(null, new FatalExceptionEventArgs( "RunInBackground task failed", task.Exception)); }