error handling in global.asa

K

klhaines

Hello.

This is the first time I've ever used JavaScript to write the global.asa
file. I don't have extensive JavaScript experience and use it mostly for
simple website functions (mouse rollovers, etc.). I would normally use
VBScript but am working on a coworker's script and don't have time to
rewrite it.

How can I handle errors in the global.asa?

I'm having global.asa update a database table. If there is an error, I want
to show nothing to the user and just end the function. But *I* would like
to know if and why the script stops working. Writing error codes to a
session variable would be an idea, as I could call them up on a different
page. But I'm not sure how to do this.

Any assistance would be appreciated.

Thank you,

Kim
 
K

klhaines

OK, I think I've got it. Somebody tell me if this is wrong.

In my Session_OnStart, I use try-catch, and in catch, I set
Application('errormsg') = ("An exception occurred in the script. Error name:
" + e.name + ". Error message: " + e.message)

In another page (for my eyes only), I display Application('errormsg').

Do you see any problems with this?

If the script does not execute, it is not a problem for the user. (The
script updates a text file with data from the database.)

Thanks.
 

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
474,082
Messages
2,570,586
Members
47,209
Latest member
Ingeborg61

Latest Threads

Top