Error Handling In ASP

E

Erencans

Hi to all,
I want to error handling in ASP. But i think that ASP is not enough for
error handling. I have got two chance.
1. I can prapare an error page and control throught IIS.
2. I can use on error resume next.

For 1. This is a general handling. I want to handle local error. Maybe i do
special thing when error occured.
For 2. I have to write alot of lines code. I have to control every line.

I wait your opinion.
Thanks alot.

Note: I must use ASP.
 
R

Ray Costanzo [MVP]

What do you mean by local error? What's the question here?

Ray at work
 
E

Erencans

I mean that for example i start a database transaction so an error occured. I
want to rollback transaction with error handling. i can do it in error page
but i think it is not a good way. Because i have to control that is there a
connection and transaction.Maybe i don't want rollback transaction every
error. Like this...

I hope i can explain what i mean.
 
P

Patrice

This is not an all or nothing option.

IMO use
http://support.microsoft.com/default.aspx?scid=kb;en-us;224070 (this is 1.)

It will allow to trap all errors you are not prepared to handle.

I would use 2 on very rare occasion only if I have no way to do it otherwise
(for example you could test for file existance instead of trapping the error
because the file is not available or checking a divider before a division
instead of trapping a divide by zero error). Also 2 is usefull only if your
application could do something about it and if you have a good idea of what
could goes wrong.

So in short I would use option #1 and would perhaps have one or two (or
zero) on error resume next line in the whole application...
 
R

Ray Costanzo [MVP]

How about rolling back the transaction at the database level instead of the
application level? What kind of database?

Ray at work
 
E

Erencans

Thanks alot for opinions. Why don't ASP support label defitiniton like VB.
Like On Error Goto label... It could very useful for me.
 
P

Patrice

Don't know but I'm not really a great "on error" fan. What is the exact
siutation you are facing ? What is the error you would like to handle ? How
frequent it is ?

Start at least with option #1. It will at least allows to see all errors
(the error page could mail you error details).
 
E

Erencans

Hi Patrice,
Thanks for your help. I'll solve it with number 1.
Thanks a lot again.

(e-mail address removed)
 

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,768
Messages
2,569,574
Members
45,050
Latest member
AngelS122

Latest Threads

Top