Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 723
  • Last Modified:

How do I trap for a script timeout error ASP0113.

Does anyone know how to trap for script timeout errors, so that if it happens I can present a user friendly message instead of the message

"The maximum amount of time for a script to execute was exceeded. You can change the limit by specifying a new value for the property Server.ScriptTimeOut or by changing the value in the IIS administration tools."

Please note that I have already increased the timeout value . I am looking for a generic way for testing for script timeout rather than a way to improve performance.
0
davejcole
Asked:
davejcole
  • 3
1 Solution
 
CJ_SCommented:
AFAIK there is no way...
0
 
Michel SakrCommented:
this error is thrown by the asp.dll i think..
0
 
makerpCommented:
no way, the script will time out and end, there is no way to trap that, worse still no way to inform the browser as i assume the connection will go when the script ends.
0
 
Michel SakrCommented:
you can try to fetch the content of the page from another asp page .. this is a turn around to do it..

How do I read the contents of a remote web page?    
You can include static txt and HTML files from remote servers by using a component (such as AspHTTP (http://www.serverobjects.com/products.htm), ASPTear (http://www.alphasierrapapa.com/ComponentCenter/AspTear/), or VB's built in InetCtrls) to parse the remote URL's content.
 
You can also try this method out, it uses the MSXML objects which are installed with Windows 2000 (or you can download them here (http://download.microsoft.com/download/xml/Install/3.0/WIN98Me/EN-US/msxml3.exe) for other operating systems):
 
<%
    url = "http://www.espn.com/
    set xmlhttp = server.CreateObject("Microsoft.XMLHTTP")
    xmlhttp.open "GET", url, false
    xmlhttp.send "" 
    Response.write xmlhttp.responseText
%>


the last method is recommended.. you simply check for the timeout error.. if it didn't timeout then display the content, otherwise redirect to your default error template

0
 
Michel SakrCommented:
<%
   url = "yourtarget.asp"
   set xmlhttp = server.CreateObject("Microsoft.XMLHTTP")
   xmlhttp.open "GET", url, false
   xmlhttp.send "" 
   if instr(xmlhttp.responseText,"Timed out ..etc fetch an exact  sentence from the timout page") then
set xmlhttp = nothing
response.redirect "scripttimedout.asp"
else
Response.write xmlhttp.responseText
set xmlhttp = nothing
end if
%>


0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now