Skip to content

Instantly share code, notes, and snippets.

@einarwh
Created June 27, 2014 21:29
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 einarwh/7b0aec7f7f72c8e5bdc8 to your computer and use it in GitHub Desktop.
Save einarwh/7b0aec7f7f72c8e5bdc8 to your computer and use it in GitHub Desktop.
TR Call<TR, TE>(
Func<TR> f,
Func<TE, TR> h)
where TE : Exception
{
try {
return f();
}
catch (TE ex) {
return h(ex);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment