Forum Post: Simple Error Handling

  • Thread starter Thread starter Thomas Mercer-Hursh
  • Start date Start date
Status
Not open for further replies.
T

Thomas Mercer-Hursh

Guest
I keep learning more about error handling ... by discovering things that I didn't know. I started out my current project with catch blocks for AppError and SysError. The former logging ReturnValue and the latter logging GetMessages and the CallStack. Then, because of .NET errors from Proparse, it was suggested that I add a catch block for just Error which also included GetMessages and CallStack. This seemed to help. But, now some new questions. Having gone back to the manual because of some issues, I see that Error is an interface, not a superclass. So, I'm wondering if my third catch block above shouldn't be for ProError instead. Would it make any difference? I am currently doing some little batch utilities which don't have all the logging of the main project. So, I thought I would just put in a simple catch block for Error and dump the GetMessages and CallStack to the output file in the unlikely event that something went wrong. But, I find that GetMessages doesn't give one the ReturnValue if I throw an AppError. So, does this mean that I need at least two catch blocks for AppError and Error (or ProError)? Or do I actually need all three?

Continue reading...
 
Status
Not open for further replies.
Back
Top