Error Handling In ASP

Discussion in 'ASP General' started by Erencans, Nov 9, 2005.

  1. Erencans

    Erencans Guest

    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.
     
    Erencans, Nov 9, 2005
    #1
    1. Advertising

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

    Ray at work

    "Erencans" <> wrote in message
    news:...
    > 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.
     
    Ray Costanzo [MVP], Nov 9, 2005
    #2
    1. Advertising

  3. Erencans

    Erencans Guest

    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.



    "Ray Costanzo [MVP]" wrote:

    > What do you mean by local error? What's the question here?
    >
    > Ray at work
    >
    > "Erencans" <> wrote in message
    > news:...
    > > 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.

    >
    >
    >
     
    Erencans, Nov 9, 2005
    #3
  4. Erencans

    Patrice Guest

    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...

    --
    Patrice

    "Erencans" <> a écrit dans le message de
    news:...
    > 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.
     
    Patrice, Nov 9, 2005
    #4
  5. How about rolling back the transaction at the database level instead of the
    application level? What kind of database?

    Ray at work

    "Erencans" <> wrote in message
    news:...
    >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.
    >
    >
    >
    > "Ray Costanzo [MVP]" wrote:
    >
    >> What do you mean by local error? What's the question here?
    >>
    >> Ray at work
    >>
    >> "Erencans" <> wrote in message
    >> news:...
    >> > 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.

    >>
    >>
    >>
     
    Ray Costanzo [MVP], Nov 9, 2005
    #5
  6. Erencans

    Erencans Guest

    I connect to SQL Server via ADO. I'll use transaction with ADO.

    "Ray Costanzo [MVP]" wrote:

    > How about rolling back the transaction at the database level instead of the
    > application level? What kind of database?
    >
    > Ray at work
    >
    > "Erencans" <> wrote in message
    > news:...
    > >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.
    > >
    > >
    > >
    > > "Ray Costanzo [MVP]" wrote:
    > >
    > >> What do you mean by local error? What's the question here?
    > >>
    > >> Ray at work
    > >>
    > >> "Erencans" <> wrote in message
    > >> news:...
    > >> > 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.
    > >>
    > >>
    > >>

    >
    >
    >
     
    Erencans, Nov 9, 2005
    #6
  7. Erencans

    Erencans Guest

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


    "Patrice" wrote:

    > 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...
    >
    > --
    > Patrice
    >
    > "Erencans" <> a écrit dans le message de
    > news:...
    > > 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.

    >
    >
    >
     
    Erencans, Nov 9, 2005
    #7
  8. Erencans

    Patrice Guest

    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).

    --
    Patrice

    "Erencans" <> a écrit dans le message de
    news:...
    > Thanks alot for opinions. Why don't ASP support label defitiniton like VB.
    > Like On Error Goto label... It could very useful for me.
    >
    >
    > "Patrice" wrote:
    >
    > > 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...
    > >
    > > --
    > > Patrice
    > >
    > > "Erencans" <> a écrit dans le message

    de
    > > news:...
    > > > 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.

    > >
    > >
    > >
     
    Patrice, Nov 9, 2005
    #8
  9. Erencans

    Erencans Guest

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




    "Patrice" wrote:

    > 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).
    >
    > --
    > Patrice
    >
    > "Erencans" <> a écrit dans le message de
    > news:...
    > > Thanks alot for opinions. Why don't ASP support label defitiniton like VB.
    > > Like On Error Goto label... It could very useful for me.
    > >
    > >
    > > "Patrice" wrote:
    > >
    > > > 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...
    > > >
    > > > --
    > > > Patrice
    > > >
    > > > "Erencans" <> a écrit dans le message

    > de
    > > > news:...
    > > > > 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.
    > > >
    > > >
    > > >

    >
    >
    >
     
    Erencans, Nov 10, 2005
    #9
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. basha
    Replies:
    1
    Views:
    360
    Christopher Kimbell
    Nov 2, 2003
  2. Replies:
    2
    Views:
    370
  3. Mark Tarver
    Replies:
    22
    Views:
    1,325
    J Kenneth King
    Apr 26, 2009
  4. Peter
    Replies:
    34
    Views:
    1,949
    James Kanze
    Oct 17, 2009
  5. Iñaki Baz Castillo
    Replies:
    1
    Views:
    192
    Iñaki Baz Castillo
    Apr 15, 2008
Loading...

Share This Page