I\'m handling exceptions with an HttpModule in a manner such as this:
HttpModule
int errorCode = 500; HttpApplication httpApp = (HttpApplication)sender; t
You don't want the inner exception. You want:
HttpException httpEx = httpApp.Server.GetLastError() as HttpException; if (httpEx != null) errorcode = httpEx == null ? 0 : httpex.GetHttpCode();