Exceptions usage

IoSonoPiero

Active Member
Licensed User
Longtime User
Hello,
I'm using the agraham Exceptions handling libray.
Now, Is this a good thing to put in EVERY sub an exception check routine?

If not, where is a good place to check for exceptions?
 

agraham

Expert
Licensed User
Longtime User
The help tries to explain what is happening. It is a bit heavy going but the information is all there. Basically if an exception occurs in a Sub and is not handled by ErrorLabel then the user will be presented with an error message to halt or continue. So the only place you can handle an exception is in the Sub where it occurs. If the Sub is not doing anything that might cause an exception there is no need for an ErrorLabel statement in that Sub.
 

IoSonoPiero

Active Member
Licensed User
Longtime User
Very good, thank you!

For sub you mean all subs, including events fired like mouse tap, selecting someting, writing text, right?
 

IoSonoPiero

Active Member
Licensed User
Longtime User
I mean: when I put an exception catcher in a Sub, I can put into normal function AND into events (like, for example, a click event)?
 

agraham

Expert
Licensed User
Longtime User
I mean: when I put an exception catcher in a Sub, I can put into normal function AND into events (like, for example, a click event)?
Yes, event Subs are normal Subs, there is nothing special about them and you can even call them like any other Sub, they don't only have to be run by an event.
 
Top