Skip to content

Instantly share code, notes, and snippets.

@angelovstanton
Created August 23, 2015 12:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save angelovstanton/48f64a8b5cb5370c40e3 to your computer and use it in GitHub Desktop.
Save angelovstanton/48f64a8b5cb5370c40e3 to your computer and use it in GitHub Desktop.
ExceptionDispatchInfo possibleException = null;
try
{
int.Parse("a");
}
catch (FormatException ex)
{
possibleException = ExceptionDispatchInfo.Capture(ex);
}
if (possibleException != null)
{
possibleException.Throw();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment