error handling in global.asa

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • klhaines

    #1

    error handling in global.asa

    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


    ---
    Outgoing mail is certified Virus Free.
    Checked by AVG anti-virus system (http://www.grisoft.com).
    Version: 6.0.512 / Virus Database: 309 - Release Date: 8/19/2003


  • klhaines

    #2
    Re: error handling in global.asa

    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('er rormsg') = ("An exception occurred in the script. Error name:
    " + e.name + ". Error message: " + e.message)

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

    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.


    ---
    Outgoing mail is certified Virus Free.
    Checked by AVG anti-virus system (http://www.grisoft.com).
    Version: 6.0.512 / Virus Database: 309 - Release Date: 8/19/2003


    Comment

    Working...