Solved

ASP Script Timeout error

Posted on 2004-04-14
14
673 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
Comment Utility
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
Comment Utility
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
Comment Utility
Any ideas?
0
 
LVL 7

Accepted Solution

by:
brgivens earned 500 total points
Comment Utility
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
Comment Utility
so I cannot do it at the IIS ?
0
 
LVL 7

Expert Comment

by:brgivens
Comment Utility
No, AFAIK you can't
0
 

Author Comment

by:tech_question
Comment Utility
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 7

Expert Comment

by:brgivens
Comment Utility
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
Comment Utility
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
Comment Utility
No, each individual page must be modified to handle the redirect.
0
 

Author Comment

by:tech_question
Comment Utility
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
Comment Utility
I am using this ServerVariables("HTTP_REFERER")- I get null string.
0
 

Author Comment

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

Author Comment

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

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

771 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now