Solved

ASP Script Timeout error

Posted on 2004-04-14
14
683 Views
Last Modified: 2008-02-01
I have put a central error handling mechanism for my website which reports all technical glitches and emails them to me. But I am also getting the script timeout error when the script timeout is done is some of the pages. I do not want to get an email when this occurs. Basically I changed the 500-100.asp file to my ErrorHandler.asp , it catches the error and emails me and shows the user some friendly message. Now with the timeout script it should do nothing, it should not display user anything. Basically I have to skip this error from my ErrorHandling.


0
Comment
Question by:tech_question
  • 9
  • 5
14 Comments
 
LVL 7

Expert Comment

by:brgivens
ID: 10829943
If Server.GetLastError <> adErrStillExecuting Then
  ' mail yourself the error details
End If

I'm taking a guess as to which error# is the timeout you want - it's probably one or the other of these two:

adErrStillExecuting (&He7f)
adErrStillConnecting (&He81)
0
 

Author Comment

by:tech_question
ID: 10830209
My problem is that a lot of  asp pages which have the script timeout method , have their own functionality. One asp  page shows a different message for a script timeout  , another page shows a different message. So basically I want to bypass the Scripttimeout error
from IIS rather   through my ErrorHandler.asp  page .
Thanks,

Tech.
0
 

Author Comment

by:tech_question
ID: 10838356
Any ideas?
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 7

Accepted Solution

by:
brgivens earned 500 total points
ID: 10838475
How about this in the 500-100.asp file:

Dim err
err = Server.GetLastError
If err.ASPCode = adErrStillExecuting Then
  Response.Redirect err.File() & "?timeout"
Else
  ' other error handling routines
End If

In the individual asp files:

If Not IsEmpty(QueryString("timeout")) Then
  ' handle the timeout
Else
  ' normal execution
End If
0
 

Author Comment

by:tech_question
ID: 10849890
so I cannot do it at the IIS ?
0
 
LVL 7

Expert Comment

by:brgivens
ID: 10849986
No, AFAIK you can't
0
 

Author Comment

by:tech_question
ID: 10851492
brgivens -  The ErrorHandler.asp would is the umbrella for my entire website for handling technical errors and glitches, what will happen if I write my own individual error handling code in individual pages? Which one will execute?


0
 
LVL 7

Expert Comment

by:brgivens
ID: 10851505
take a look at my code again... err.File() returns the url of the file where the error occured... the cose I posted returns control back to whichever page the error originated from... I'm passing a QueryString to the page so you can distinguish between normal execution and an error.  Understand?
0
 

Author Comment

by:tech_question
ID: 10851839
I am sorry , I should have looked at the code in more detail. But my problem is I do not have access to the individual asp files, but I know that they do indeed handle the Script Time out error and customize the user. So will the user get the customized message whatever is given to the user in the inidividual pages if I write the below code in my Central Error Handler asp file.

//
If err.ASPCode = ScriptTimeOutError (I do not know the exact code for this error) Then

  Response.Redirect err.File()

end if

0
 
LVL 7

Expert Comment

by:brgivens
ID: 10853070
No, each individual page must be modified to handle the redirect.
0
 

Author Comment

by:tech_question
ID: 10859956
brgivens - Can I  get the exact URL from which the error has occured reported onto my ErrorHandler.asp. Because if they are include files, I am unable to get to know from which url the error is being thrown.

Eg: www.xxx.com/123.asp

if there is error in 123_include.inc which in included in 123.asp, I should get the URL as www.xxx.com/123.asp to be reported.


0
 

Author Comment

by:tech_question
ID: 10860306
I am using this ServerVariables("HTTP_REFERER")- I get null string.
0
 

Author Comment

by:tech_question
ID: 10860427
I understand why HTTP_REFERER does not work! but I need the requirement  as I stated!
0
 

Author Comment

by:tech_question
ID: 10862787
I answered this myself ServerVariables("http_url ") and ServerVariables("ServerName")
!
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

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

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question