Actually Im wrong, you cant do that in ASP.
Your best bet is a custom error page.
http://www.devarticles.com
Main Topics
Browse All TopicsHi. I have a page that sends information to the back end of our system.
If the back end is down I would like it to store the information in a database.
Is there a way to use "on error" to call a function instead of "resume next"?
What I would like is to head my page like this:
<%
on error call process()
but that doesn't seem to work.
Can someone help???
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Actually Im wrong, you cant do that in ASP.
Your best bet is a custom error page.
http://www.devarticles.com
about On Error Resume Next: check this out: http://www.experts-exchang
That was a typo on my part, meant to put Goto Process. Neither will work anyway, so its irrelevant. Error handling is primitive in ASP , not like VB really.
As I suggested, a custom 500 error page is probably the best option for dealing with errors. I use them to display an error message from a branded page, and it also emails me details of the error when they happen so I know theat there is a problem on the page...
Hi foreverdita,
The "On Error Resume Next" statement just enables error handling in your script; it doesn't actually call a procedure. The way to use thi is to tuen on error handling using the "On Error Resume Next" statement, execute a statement, and the trap your errors:
<%
On Error Resume Next 'enable error handling
' do domething:
cnn.Open
'handle possible errors:
If Err.Number <> 0 Then Response.Write "Error number:" & Err.Number ' for example
%>
you can find a detailed good reference on using error handling in vbscript here: http://www.juicystudio.com
Socket.TCP error '8000ffff'
Error while processing Socket opperation: Connection refused
/newsitedesign/requestcata
Here is the error that comes up when our back end is down. (I turned it off for demonstration). The databases will still be up as they are seperate from the back end system.
It doesn't work with me...
I have:
*default.asp
<!--#include file="errorpage.asp"--> 'to view the error descr.
<%if error<>0 then
dim errorobj
set errorobj = new CError 'from errorpage.asp
errorobj.displayerror
set errorobj = nothing
end if
%>
*newpage.asp
<!--include file="default.asp"-->
<%on error goto 0%>
<%
'here some code to generate error
%>
I do get an error message, but that standard error, and not the errorpage.asp
Howcome?
Regards
ThaZar
Business Accounts
Answer for Membership
by: SlimshaneeyPosted on 2004-04-28 at 06:58:59ID: 10939160
Change to
<%
on error call process
Then Have this at the end of the page
<%
process:
'Code to do stuff
%>