Robust Error Handling

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

    #1

    Robust Error Handling

    I need some good ideas or references for robust error handling in VB.NET.
    I am using try catch but find myself using the generic exception handler. I
    would like to get more precise error handling so I can take appropriate
    action and display user friendly error messages back to the client. The
    problem I am getting is determining which error types can be thrown for each
    function/sub and handling them. Is there a way to determine all the
    possible error types to catch and handle them? Or should I write a generic
    error handling routine to pass back all errors through an event? Any
    suggestions would be great.

    John


  • tomb

    #2
    Re: Robust Error Handling

    The various sub-classes of exceptions are categorized according to the
    type of error. For instance, File IO exceptions, Numerical exceptions,
    and the like. What you will focus on in any procedure will depend on
    what is actually taking place there.

    The last exception catch, however, should always be the generic
    Exception, so nothing will slip by unhandled by mistake.

    T

    John Wright wrote:
    I need some good ideas or references for robust error handling in VB.NET.
    I am using try catch but find myself using the generic exception handler. I
    would like to get more precise error handling so I can take appropriate
    action and display user friendly error messages back to the client. The
    problem I am getting is determining which error types can be thrown for each
    function/sub and handling them. Is there a way to determine all the
    possible error types to catch and handle them? Or should I write a generic
    error handling routine to pass back all errors through an event? Any
    suggestions would be great.
    >
    John
    >
    >
    >

    Comment

    • lord.zoltar@gmail.com

      #3
      Re: Robust Error Handling

      On Feb 12, 11:12 am, "John Wright" <riley_wrig...@ hotmail.comwrot e:
      I need some good ideas or references for robust error handling in VB.NET.
      I am using try catch but find myself using the generic exception handler. I
      would like to get more precise error handling so I can take appropriate
      action and display user friendly error messages back to the client. The
      problem I am getting is determining which error types can be thrown for each
      function/sub and handling them. Is there a way to determine all the
      possible error types to catch and handle them? Or should I write a generic
      error handling routine to pass back all errors through an event? Any
      suggestions would be great.
      >
      John
      I sometimes write my own exception handling class. I always use the
      Excetion in my try..catch blocks, and then when I catch an Exception,
      I pass it (and sometimes an address of a delegate in the calling
      class, if lots of extra work needs to be done for cleanup) to my own
      exception handling class to decide which error message and which style
      dialogue to display.
      That way, all IO exceptions (for example) can be handled in the same
      way in the same place.
      This I find works best for large applications, but to each his/her own!

      Comment

      • Michael C

        #4
        Re: Robust Error Handling

        "John Wright" <riley_wrightx@ hotmail.comwrot e in message
        news:%23DV6TCsT HHA.5012@TK2MSF TNGP04.phx.gbl. ..
        >I need some good ideas or references for robust error handling in VB.NET. I
        >am using try catch but find myself using the generic exception handler. I
        >would like to get more precise error handling so I can take appropriate
        >action and display user friendly error messages back to the client. The
        >problem I am getting is determining which error types can be thrown for
        >each function/sub and handling them. Is there a way to determine all the
        >possible error types to catch and handle them? Or should I write a generic
        >error handling routine to pass back all errors through an event? Any
        >suggestions would be great.
        Download reflector so you can find everything that inherits from exception.
        >
        John
        >

        Comment

        • Larry Linson

          #5
          Re: Robust Error Handling

          vb6 had some decent automated errorhandler add-ins

          I think that MZTOOLS had one; as did the Office 2000 developers
          edition

          FUCK DOTNOT

          Comment

          Working...