ExceptionExtensions
Contains extension methods on the Exception class.
public static void RethrowWithOriginalStackTraceIfDiffersFrom(this Exception exceptionPossiblyToThrow, Exception exceptionToCompare)
Rethrows the extended Exception, exceptionPossiblyToThrow, using the ExceptionDispatchInfo class to rethrow it with its original stack trace, if exceptionPossiblyToThrow differs from exceptionToCompare.