Clemens Vasters - Are you catching falling knives?里给了一个判断C#的exception是不是fatal的代码,可以参考参考。
public static bool IsFatal(this Exception exception) { while (exception != null) { if (exception as OutOfMemoryException != null && exception as InsufficientMemoryException == null || exception as ThreadAbortException != null || exception as AccessViolationException != null || exception as SEHException != null || exception as StackOverflowException != null) { return true; } else { if (exception as TypeInitializationException == null && exception as TargetInvocationException == null) { break; } exception = exception.InnerException; } } return false; }