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