Error handling

Discussion in 'ASP .Net' started by =?Utf-8?B?U2FuZHk=?=, Jun 14, 2005.

  1. Hello -

    I have a Page_Load Sub that essentially just fills a couple of
    dropdownlists. Is it recommended to wrap something of this nature in a
    Try-Catch-Finally-End Try block?

    Additionally, I have a few small subs that relate to paging datagrids. Is
    it necessary to wrap this in error-handling code?

    --
    Sandy
     
    =?Utf-8?B?U2FuZHk=?=, Jun 14, 2005
    #1
    1. Advertising

  2. =?Utf-8?B?U2FuZHk=?=

    bradley Guest

    Errors handing should be implemented in those situations where you want an
    alternative series of steps to be executed when the usual series of steps
    throws an error. This is typically done for those steps that are dependent
    on external factors and could potentially fail, but may succeed again given
    more interaction by the user or just a small amount of time. For example,
    programming which accesses the database are likely candidates. If the user
    attempts to submit a form for a new invoice and the transaction fails due to
    record locking, then you would want to re-direct them to a special page and
    possibly try to cache the form data in a such a way that it could be
    re-submitted by clicking the button again. However, if you have programming
    that simply handles events or populates properties on a control, then there
    is no reason for it to fail unless there is a programming bug, in which case
    allowing the user to re-try would be useless.


    "Sandy" <> wrote in message
    news:...
    > Hello -
    >
    > I have a Page_Load Sub that essentially just fills a couple of
    > dropdownlists. Is it recommended to wrap something of this nature in a
    > Try-Catch-Finally-End Try block?
    >
    > Additionally, I have a few small subs that relate to paging datagrids. Is
    > it necessary to wrap this in error-handling code?
    >
    > --
    > Sandy
     
    bradley, Jun 14, 2005
    #2
    1. Advertising

  3. Sandy,

    You handle errors in every place where you need to handle errors. You might
    want to handle errors for various reasons. You might want to supply your own
    customized errors messages. Or you might want to ignore some errors. There
    are no general recommendations, everything depends on the application logic
    and requirements.

    Eliyahu

    "Sandy" <> wrote in message
    news:...
    > Hello -
    >
    > I have a Page_Load Sub that essentially just fills a couple of
    > dropdownlists. Is it recommended to wrap something of this nature in a
    > Try-Catch-Finally-End Try block?
    >
    > Additionally, I have a few small subs that relate to paging datagrids. Is
    > it necessary to wrap this in error-handling code?
    >
    > --
    > Sandy
     
    Eliyahu Goldin, Jun 14, 2005
    #3
    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. Kenneth Keeley

    Error Handling

    Kenneth Keeley, Jul 1, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    382
    Kenneth Keeley
    Jul 1, 2003
  2. VSK
    Replies:
    1
    Views:
    792
    Alvin Bruney
    Jul 29, 2003
  3. Mark Tarver
    Replies:
    22
    Views:
    1,315
    J Kenneth King
    Apr 26, 2009
  4. Peter
    Replies:
    34
    Views:
    1,942
    James Kanze
    Oct 17, 2009
  5. Iñaki Baz Castillo
    Replies:
    1
    Views:
    190
    Iñaki Baz Castillo
    Apr 15, 2008
Loading...

Share This Page