Skip to content

Instantly share code, notes, and snippets.

@ThomasArdal
Last active August 29, 2015 14:06
Show Gist options
  • Save ThomasArdal/87cd88d682ae0c44cd76 to your computer and use it in GitHub Desktop.
Save ThomasArdal/87cd88d682ae0c44cd76 to your computer and use it in GitHub Desktop.
Decompiled try catch with exception filter
try
{
Program.DoSomeHttpRequest();
return;
}
catch
{
Console.WriteLine("Generic Error");
return;
}
object arg_0B_0;
HttpException expr_10 = arg_0B_0 as HttpException;
int arg_28_0;
if (expr_10 == null)
{
arg_28_0 = 0;
}
else
{
HttpException e = expr_10;
arg_28_0 = (((e.GetHttpCode() == 400) > false) ? 1 : 0);
}
endfilter(arg_28_0);
object arg_3A_0;
HttpException expr_3F = arg_3A_0 as HttpException;
if (expr_3F != null)
{
goto IL_46;
}
int arg_57_0 = 0;
goto IL_57;
IL_46:
HttpException e2 = expr_3F;
arg_57_0 = (((e2.GetHttpCode() == 500) > false) ? 1 : 0);
IL_57:
endfilter(arg_57_0);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment