Add static ExceptionDispatchInfo.Throw method
authorStephen Toub <stoub@microsoft.com>
Sun, 26 Mar 2017 18:26:34 +0000 (14:26 -0400)
committerStephen Toub <stoub@microsoft.com>
Sun, 26 Mar 2017 18:26:34 +0000 (14:26 -0400)
Commit migrated from https://github.com/dotnet/coreclr/commit/49fba828bdc1cfc437e1adfbdaf0e0b498c28872

src/coreclr/src/mscorlib/src/System/Runtime/ExceptionServices/ExceptionServicesCommon.cs

index 9e87b21..8d5ced0 100644 (file)
@@ -129,5 +129,9 @@ namespace System.Runtime.ExceptionServices
             m_Exception.RestoreExceptionDispatchInfo(this);
             throw m_Exception;
         }
+
+        // Throws the source exception, maintaining the original bucketing details and augmenting
+        // rather than replacing the original stack trace.
+        public static void Throw(Exception source) => Capture(source).Throw();
     }
 }