Exception Handling

Discussion in 'ASP .Net' started by Robert Smith, Apr 21, 2008.

  1. Robert Smith

    Robert Smith Guest

    Hi,
    Could anyone tell me where would be the best place to deal with
    exceptions,
    within the form itself or at the lower level within the class that is called
    e.g I have a form with the following code

    AddAgencyToDb
    this.sysAgency.RemoveAgency(IntKey)

    then I have a class called sysAgency

    public void RemoveAgency(IntKey)
    {

    // add code to remove agency with intkey

    }

    Should the try catch be in the form or within the class sysAgency

    Thanx
    Robert
     
    Robert Smith, Apr 21, 2008
    #1
    1. Advertising

  2. Robert Smith

    NH Guest

    I put exception handling in the global.asax file.

    But if there is something that I think may go wrong in some specific sub or
    piece of code (e.g. in an excel file import routine) I would put more
    specific exception handling in that sub.

    "Robert Smith" wrote:

    > Hi,
    > Could anyone tell me where would be the best place to deal with
    > exceptions,
    > within the form itself or at the lower level within the class that is called
    > e.g I have a form with the following code
    >
    > AddAgencyToDb
    > this.sysAgency.RemoveAgency(IntKey)
    >
    > then I have a class called sysAgency
    >
    > public void RemoveAgency(IntKey)
    > {
    >
    > // add code to remove agency with intkey
    >
    > }
    >
    > Should the try catch be in the form or within the class sysAgency
    >
    > Thanx
    > Robert
     
    NH, Apr 21, 2008
    #2
    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. Babu
    Replies:
    1
    Views:
    2,924
    Jim Gibson
    Mar 10, 2005
  2. Mark Tarver
    Replies:
    22
    Views:
    1,336
    J Kenneth King
    Apr 26, 2009
  3. Peter
    Replies:
    34
    Views:
    1,974
    James Kanze
    Oct 17, 2009
  4. VSK
    Replies:
    0
    Views:
    255
  5. Iñaki Baz Castillo
    Replies:
    1
    Views:
    200
    Iñaki Baz Castillo
    Apr 15, 2008
Loading...

Share This Page