|
-
Jan 22nd, 2015, 02:32 PM
#19
Thread Starter
Frenzied Member
Re: Best error handling option for a library that doesn't throw exceptions?
 Originally Posted by SJWhiteley
Further, I'd reiterate not using exceptions in this case. As already noted, exceptions are expensive. Why not simply return true or false from a routine to indicate success or failure? If it fails then don't continue. It isn't a hard and fast rule, but it's what I'd do, in the situation you are in.
Largely because the expense doesn't concern me at startup and I like having the StackTrace info to pinpoint what happened (hopefully). Once running, most of my functions do return boolean and pass an error message back if one was trapped.
Wouldn't an Exit Sub from Form_Load just cause the program to hang (assuming form isn't shown yet) or will that fire some other event? I'd rather go to the Finally statement so it cleans up anything that got created. Is there some "goto Finally" type command? That's kind of what I was expecting Application.Exit to do rather than continuing with the rest of the routine.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|