Last active
August 29, 2015 14:06
-
-
Save ThomasArdal/4add6946ecd2db599386 to your computer and use it in GitHub Desktop.
Standard try catch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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