Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Commit

Permalink
Merge pull request #10489 from stephentoub/capturethrow
Browse files Browse the repository at this point in the history
Add static ExceptionDispatchInfo.Throw method
  • Loading branch information
stephentoub authored Mar 26, 2017
2 parents 840554e + 49fba82 commit 48e2448
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,5 +129,9 @@ public void Throw()
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();
}
}

0 comments on commit 48e2448

Please sign in to comment.