From 42601950754f7fbc3df9f35a282fee45fa33af49 Mon Sep 17 00:00:00 2001 From: Stephen Toub Date: Sun, 26 Mar 2017 14:26:34 -0400 Subject: [PATCH] Add static ExceptionDispatchInfo.Throw method Commit migrated from https://github.com/dotnet/coreclr/commit/49fba828bdc1cfc437e1adfbdaf0e0b498c28872 --- .../src/System/Runtime/ExceptionServices/ExceptionServicesCommon.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/coreclr/src/mscorlib/src/System/Runtime/ExceptionServices/ExceptionServicesCommon.cs b/src/coreclr/src/mscorlib/src/System/Runtime/ExceptionServices/ExceptionServicesCommon.cs index 9e87b21..8d5ced0 100644 --- a/src/coreclr/src/mscorlib/src/System/Runtime/ExceptionServices/ExceptionServicesCommon.cs +++ b/src/coreclr/src/mscorlib/src/System/Runtime/ExceptionServices/ExceptionServicesCommon.cs @@ -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(); } } -- 2.7.4