How to trap System.Web.HttpException: Request timed out.?

From: Jack Wright (sunil_at_volcanomail.com)
Date: 02/29/04


Date: 29 Feb 2004 04:13:16 -0800

Dear All,
   I have a web Application "http://localhost/Web/WebForm1.aspx" that
calls a WebService from
"http://localhost/webserviceapp/service1.asmx"...I have set the
executionTimeout to 10 secs in Web.Config where my WebService is
installed.
<httpRuntime executionTimeout="10" appRequestQueueLimit="2" />

When I call a method "TestPlan" which takes more than 10 secs my web
Page gets the following error:
Error: Client found response content type of 'text/html;
charset=utf-8', but expected 'text/xml'. The request failed with the
error message: --
Server Error in '/WebServiceApp' Application.
----------------------------------------------------------------------------

Request timed out.
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: Request timed out.

Source Error:

An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of
the exception can be identified using the exception stack trace below.

Stack Trace:
[HttpException (0x80004005): Request timed out.]

==================================================================
How do trap this error in an elagant way and show it to the user?
I tried to trap the error on Application_Error function of Global.asax
of both my Web page and the WebService...
Sub Application_Error(ByVal sender As Object, _
 ByVal e As EventArgs)
    ' Get the actual error that brought us here
    Dim ex As Exception = _
     Server.GetLastError.InnerException
    ' Display basic error information
    Response.Write("An error occurred in the application:<br>")
    Response.Write(ex.Message & "<br>")
    Response.Write("Stack trace:<br>")
    Dim s As StringBuilder = New StringBuilder(ex.StackTrace)
    Response.Write(s.Replace(" at ", " at<br> "))
    Response.End()
    ' Clear the error
    Server.ClearError()
End Sub
But it did not work...I tried to trap the event on the Page's onError
method too it did not work...could someone please help...

TALIA

Many Regards
Jack



Relevant Pages

  • How to trap System.Web.HttpException: Request timed out.?
    ... executionTimeout to 10 secs in Web.Config where my WebService is ... Exception Details: System.Web.HttpException: Request timed out. ... An unhandled exception was generated during the execution of the ... I tried to trap the error on Application_Error function of Global.asax ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Runtime Syntax Checker
    ... If any Tcl command sets a return code other than zero, ... script to abort, but any following scripts will execute. ... In C, you can ignore errors, execution ... The caller must then handle the exception. ...
    (comp.lang.tcl)
  • Re: How to force the program to continue after unhandled exception detection
    ... The webservice is pretty much used by the client app. ... I understand that the handler ... potential exception could be itself a design problem leading at least ... private void button1_Click{ ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Updating a DB via SQL is giving me a headache
    ... problem will never be executed using the Try/Catch block, ... Connection was certainly created and opened, ... If so, null is not an Integer, and that could throw an exception. ... is handled, execution continues. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Code design ideas?
    ... I implemented the following pattern in my webservice. ... Usually it is the Message of the Exception. ... severity levels: warning and error. ...
    (microsoft.public.dotnet.languages.csharp)