Skip to content

Instantly share code, notes, and snippets.

@ThomasArdal
Last active August 29, 2015 14:06
Show Gist options
  • Save ThomasArdal/4add6946ecd2db599386 to your computer and use it in GitHub Desktop.
Save ThomasArdal/4add6946ecd2db599386 to your computer and use it in GitHub Desktop.
Standard try catch
try
{
DoSomeHttpRequest();
}
catch (System.Web.HttpException e)
{
switch (e.GetHttpCode())
{
case 400:
WriteLine("Bad Request");
case 500:
WriteLine("Internal Server Error");
default:
WriteLine("Generic Error");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment