G
Guest
I have an HttpModule used for Unhandled Exception processing. The module
monitors both
application.Error += new EventHandler(OnError); //regular UHE
AppDomain.CurrentDomain.UnhandledException += new
UnhandledExceptionEventHandler(OnUhe); //UHE on threads
If I do a throw, the first one gets it.
If I do a throw in a thread, the second one gets it.
In each case I process the exception as follows:
HttpContext.Current.Response.Clear();
HttpContext.Current.Response.ClearContent();
HttpContext.Current.Response.Write( a web page with pretty message);
HttpContext.Current.Response.Flush();
HttpContext.Current.Server.ClearError();
HttpContext.Current.Response.End();
This works fine for theads and throws.
When I was testing a file upload control and trying to upload a file greater
than
<httpRuntime maxRequestLength="4096" />
Both events fire and I get a generic web page that says:
"The connection to the server was reset while the page was loading."
How come I get both events and how come my pretty error page is not
displayed? I put in break points and the page creation stuff does get hit.
Actually the page creation code gets hit twice.
thanks,
monitors both
application.Error += new EventHandler(OnError); //regular UHE
AppDomain.CurrentDomain.UnhandledException += new
UnhandledExceptionEventHandler(OnUhe); //UHE on threads
If I do a throw, the first one gets it.
If I do a throw in a thread, the second one gets it.
In each case I process the exception as follows:
HttpContext.Current.Response.Clear();
HttpContext.Current.Response.ClearContent();
HttpContext.Current.Response.Write( a web page with pretty message);
HttpContext.Current.Response.Flush();
HttpContext.Current.Server.ClearError();
HttpContext.Current.Response.End();
This works fine for theads and throws.
When I was testing a file upload control and trying to upload a file greater
than
<httpRuntime maxRequestLength="4096" />
Both events fire and I get a generic web page that says:
"The connection to the server was reset while the page was loading."
How come I get both events and how come my pretty error page is not
displayed? I put in break points and the page creation stuff does get hit.
Actually the page creation code gets hit twice.
thanks,