Unhandled Exceptions and Maximum request length exceeded

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,
 
B

bruce barker

in http there is no way to tell the browser to stop sending the request
other than closing the connection. as the browser could not complete the
request, it does not bother reading the response.

-- bruce (sqlwork.com)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top