dcsimg


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Page 8 of 8 FirstFirst ... 678
Results 106 to 109 of 109

Thread: Correct Error Handling

  1. #106
    Michael Culley Guest

    Re: Correct Error Handling


    Another question I forgot:

    From the previous posts it seams that when an error occurs, most people add
    that function's name to a list and re-raise the error, then dump it all to
    a file in the top level function. But how do you tell which is the top level
    function? eg Text1_Change can be a top level function, but it can also be
    nested if it is raised by code such as Text1.Text="ABC".

    Thanks again

    Michael Culley

    "Michael Culley" <m_culley@one.net.au> wrote:
    >
    >I have a couple of further questions on error handling:
    >
    >1) Where does everyone log their errors. The 2 choices seam to be a DB or
    >a text file.
    >
    >2) How does everyone deal with errors across different projects. Do you

    pass
    >an error object into dlls/ocxs referenced in your project?
    >
    >Thanks in advance
    >
    >Michael Culley
    >
    >
    >"Anthony Jones" <yadayadayada@msn.com> wrote:
    >>>>

    >>Elimination of risk and possible bugs is the top priority, even at the
    >>expense of meeting real needs.
    >><<
    >>
    >>I'll second that! Schedule risk is usually the top risk they want to
    >>eliminate. I have heard of apps being delivered and installed that contain
    >>merely an about box and splash screen just so the client can inform the
    >>upper echelons of their organisation that 'phase 1' has been installed

    on
    >>time.
    >>Politics, yuck.
    >>
    >>
    >>--
    >>Anthony Jones
    >>Secta Group Ltd
    >>
    >>
    >>

    >



  2. #107
    Jim Pragit Guest

    Re: Correct Error Handling


    "Michael Culley" <m_culley@one.net.au> wrote:
    >
    >I have a couple of further questions on error handling:
    >
    >1) Where does everyone log their errors. The 2 choices seam to be a DB or
    >a text file.


    Text file, although a DB is fine, too. One major advantage of the text file
    approach is its simplicity. That is, I can use the same error handling code
    across all my projects.

    >2) How does everyone deal with errors across different projects. Do you

    pass
    >an error object into dlls/ocxs referenced in your project?


    I pass them up to the client.

    - Jim


  3. #108
    Anthony Jones Guest

    Re: Correct Error Handling

    >But how do you tell which is the top level function?

    Simply Sub Main and any event procedure no matter how it is raised.

    Even if an event is generated as a response to code (like in your example)
    if you re-raise an error in an event procedure you'll get a run-time error.
    That goes for events generated by classes as well.

    I use a framework where all in-house controls have an Error event. This
    event is raised by the error handlers of the controls 'top-level'
    procedures. This at least lets the client project know there is an error
    and gives it a chance to handle it.




    --
    Anthony Jones
    Secta Group Ltd




  4. #109
    Michael Culley Guest

    Re: Correct Error Handling


    Anthony,

    I didn't realise that. I guess I should have known this.

    The error event makes sense for general components such as, say a custom
    combo box or textbox. In this case I would not want to have it rely on my
    error object because another project may use the same control but a diff
    error object.

    Michael Culley




    "Anthony Jones" <yadayadayada@msn.com> wrote:
    >>But how do you tell which is the top level function?

    >
    >Simply Sub Main and any event procedure no matter how it is raised.
    >
    >Even if an event is generated as a response to code (like in your example)
    >if you re-raise an error in an event procedure you'll get a run-time error.
    >That goes for events generated by classes as well.
    >
    >I use a framework where all in-house controls have an Error event. This
    >event is raised by the error handlers of the controls 'top-level'
    >procedures. This at least lets the client project know there is an error
    >and gives it a chance to handle it.
    >
    >
    >
    >
    >--
    >Anthony Jones
    >Secta Group Ltd
    >
    >
    >



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center