Solved

ASP Script Timeout error

Posted on 2004-04-14
14
676 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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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…
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…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

912 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

17 Experts available now in Live!

Get 1:1 Help Now