[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework

GRR: Trap Request Timed Out (80004005

JP

9/11/2008 6:41:00 PM

I have a C# program that uses error handling via the Application_Error()
method in the global.asax file. The code in this method alerts me to any
unhandled exception in the program.

However, lately the program has been receiving "Request Timed Out" errors,
but it just shows the user the ugly old framework error screen rather then
processing the error, notifying me of the error, and display a beautiful
error screen to the user.

The problem turned out to be a slow SQL statement that took longer then the
httpRequest was willing to wait (I think). YES, I know you can change the
timeout setting for httpRequest inside the web.config. But the point is that
the code I have to process unhandled exceptions is not firing for THIS error.
Why and what to do to fix it so that it does process the error???
--
JP
..NET Software Developer

3 Answers

Erjan Gavalji

9/11/2008 8:24:00 PM

0

Hey Jp,

Did the error redirection work before? If so, did you for some reason change
the defaultRedirect setting of the customErrors web.config node

Or, do you have the ctx.Server.ClearError (); statement in the
Application_Error method?

Cheers,
Erjan

"JP" <JP@discussions.microsoft.com> wrote in message
news:0E5D0492-EFD6-4FC7-8241-72275A0D7092@microsoft.com...
>I have a C# program that uses error handling via the Application_Error()
> method in the global.asax file. The code in this method alerts me to any
> unhandled exception in the program.
>
> However, lately the program has been receiving "Request Timed Out" errors,
> but it just shows the user the ugly old framework error screen rather then
> processing the error, notifying me of the error, and display a beautiful
> error screen to the user.
>
> The problem turned out to be a slow SQL statement that took longer then
> the
> httpRequest was willing to wait (I think). YES, I know you can change the
> timeout setting for httpRequest inside the web.config. But the point is
> that
> the code I have to process unhandled exceptions is not firing for THIS
> error.
> Why and what to do to fix it so that it does process the error???
> --
> JP
> .NET Software Developer
>

JP

9/11/2008 10:44:00 PM

0

The Application_Error performs

Exception LastError = Server.GetLastError().GetBaseException();

The error objects gets passed to a custom DLL that store the error in a
database and send emails about the error to parties involved. It has a REF
string that contains the HTML error message to display to the user after it
returns from the DLL. Its not the DLL crashing. I can catch every error that
comes across but "Request Timed Out". Im thinking that it may be doing a
Thred.Abort() and the Application_Error never fires. This works for 10 other
apps, but this seems to be the only app throwing this particular error. Like
I said, if its throwing the error thats fine. I just want to know why I cant
capture it. Sample below

string ErrorResponse = ""; //variable to hold response from ReportError tool
string ErrorPage = null; //variable to hold friendly error page;

myUtility.Tools.ReportError NewError = new
myUtility.Tools.ReportError(LastError, ref ErrorPage, ref ErrorResponse);

Server.ClearError();
if (ErrorResponse == "")
{
if (ErrorPage != "")
{
Response.Write(ErrorPage);
}
else
{ Response.Write("Web error content not found");
}
}
else
{
Response.Write(ErrorResponse);
}
--
JP
..NET Software Developer


"Erjan Gavalji" wrote:

> Hey Jp,
>
> Did the error redirection work before? If so, did you for some reason change
> the defaultRedirect setting of the customErrors web.config node
>
> Or, do you have the ctx.Server.ClearError (); statement in the
> Application_Error method?
>
> Cheers,
> Erjan
>
> "JP" <JP@discussions.microsoft.com> wrote in message
> news:0E5D0492-EFD6-4FC7-8241-72275A0D7092@microsoft.com...
> >I have a C# program that uses error handling via the Application_Error()
> > method in the global.asax file. The code in this method alerts me to any
> > unhandled exception in the program.
> >
> > However, lately the program has been receiving "Request Timed Out" errors,
> > but it just shows the user the ugly old framework error screen rather then
> > processing the error, notifying me of the error, and display a beautiful
> > error screen to the user.
> >
> > The problem turned out to be a slow SQL statement that took longer then
> > the
> > httpRequest was willing to wait (I think). YES, I know you can change the
> > timeout setting for httpRequest inside the web.config. But the point is
> > that
> > the code I have to process unhandled exceptions is not firing for THIS
> > error.
> > Why and what to do to fix it so that it does process the error???
> > --
> > JP
> > .NET Software Developer
> >
>
>

Erjan Gavalji

9/12/2008 1:23:00 PM

0

Hey JP,

I might hve overlooked something. Do you mean that you get the HTTP error
Request Timed Out?

This is not a .NET Framework exception, that's why it cannot be caught by
the error handling code in the Global.asax file. If you don't get another
error, it could be that for some reason the database request takes too much
time to execute. I would suggest you to try running the query in a separate
page in the same domain to check what happens. If it takes too long again,
you should inspect if the problem is in the Web Server <-> SQL Server
connection, or in the query/database structure.

Check this article out, it can be of help:
http://support.microsoft.com...

Cheers,
Erjan

"JP" <JP@discussions.microsoft.com> wrote in message
news:4A1DE070-DA66-4350-9AA4-51FD9C22E182@microsoft.com...
> The Application_Error performs
>
> Exception LastError = Server.GetLastError().GetBaseException();
>
> The error objects gets passed to a custom DLL that store the error in a
> database and send emails about the error to parties involved. It has a REF
> string that contains the HTML error message to display to the user after
> it
> returns from the DLL. Its not the DLL crashing. I can catch every error
> that
> comes across but "Request Timed Out". Im thinking that it may be doing a
> Thred.Abort() and the Application_Error never fires. This works for 10
> other
> apps, but this seems to be the only app throwing this particular error.
> Like
> I said, if its throwing the error thats fine. I just want to know why I
> cant
> capture it. Sample below
>
> string ErrorResponse = ""; //variable to hold response from ReportError
> tool
> string ErrorPage = null; //variable to hold friendly error page;
>
> myUtility.Tools.ReportError NewError = new
> myUtility.Tools.ReportError(LastError, ref ErrorPage, ref ErrorResponse);
>
> Server.ClearError();
> if (ErrorResponse == "")
> {
> if (ErrorPage != "")
> {
> Response.Write(ErrorPage);
> }
> else
> { Response.Write("Web error content not found");
> }
> }
> else
> {
> Response.Write(ErrorResponse);
> }
> --
> JP
> .NET Software Developer
>
>
> "Erjan Gavalji" wrote:
>
>> Hey Jp,
>>
>> Did the error redirection work before? If so, did you for some reason
>> change
>> the defaultRedirect setting of the customErrors web.config node
>>
>> Or, do you have the ctx.Server.ClearError (); statement in the
>> Application_Error method?
>>
>> Cheers,
>> Erjan
>>
>> "JP" <JP@discussions.microsoft.com> wrote in message
>> news:0E5D0492-EFD6-4FC7-8241-72275A0D7092@microsoft.com...
>> >I have a C# program that uses error handling via the Application_Error()
>> > method in the global.asax file. The code in this method alerts me to
>> > any
>> > unhandled exception in the program.
>> >
>> > However, lately the program has been receiving "Request Timed Out"
>> > errors,
>> > but it just shows the user the ugly old framework error screen rather
>> > then
>> > processing the error, notifying me of the error, and display a
>> > beautiful
>> > error screen to the user.
>> >
>> > The problem turned out to be a slow SQL statement that took longer then
>> > the
>> > httpRequest was willing to wait (I think). YES, I know you can change
>> > the
>> > timeout setting for httpRequest inside the web.config. But the point is
>> > that
>> > the code I have to process unhandled exceptions is not firing for THIS
>> > error.
>> > Why and what to do to fix it so that it does process the error???
>> > --
>> > JP
>> > .NET Software Developer
>> >
>>
>>