How can I capture the Script timeout Error?

M

Mathieu Blais

Hi,

I need to capture the Script timeout error if that is possible. I know I can
increase the timeout value in the server settings or in the scripts itself
but I really want to make sure that no timeout situation will results as the
standard script timeout error page.

Can we do this ??

Help please.
Matt
 
R

Ray at

Turn off buffering and response.write during your loop. There isn't going
to be any scripting error if your page times out, so you have to find what
is causing things to take so long. It's often an endless loop.

Ray at work
 
M

Matt

Thanks Ray,

But how can I know that I have hit the time out ? Because I understand your
answer and it make sens but I don't just want not to receive any error
message, I want to know when it's happening in order to display a friendly
error message instead of the IIS error..

Matt
 
A

Aaron Bertrand - MVP

Set the timeout to something ridiculously high, then write better code and
fix the timeout problem. I don't believe you can trap a script timeout
error.
 
R

Ray at

Ah, I see. Create a custom error page (500).

<%
Dim oError
Set oError = Server.GetLastError
Response.Write "Sorry, there was an error. The error was " &
oErr.Description
Set oError = Nothing

%>


Ray at work
 
R

Ray at

Yes, and take Aaron's suggestion at determining what is causing the timeout.
What is causing it?

Ray at work
 
M

Matt

Oh I have no control on that, the script timeout because of the response
time of a distant database server and I have no control on it's performance
so I was wondering if I had any possibilities to trap this error.

Thanks anyway everybody. I'll do it like I was going to in the first place.
Increasing the timeout.
 
M

Matt

Yes that's a great idea but unfortunately Im working with IIS 4.0 and
correct me if I'm worng but ASP 2.0 does not support this method? But even
if I can't use it I would have a couple of question for my personnal
benefit. I have never used that kind of Custom Error page. How does that
work ? Where do you save it ? Does it need to have a specefic name or
something ?

Thank you very much for your help.

Matt
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,046
Latest member
Gavizuho

Latest Threads

Top