Exception class usage

francoisg

Active Member
Licensed User
Longtime User
Hi, just a quick one - in one of my code modules (that I would like to share with other developers) I would like to be able to throw an exception (because certain values have not been initialized etc.) but the Exception class as it currently stand does not include methods to initialize, set an exception message or throw (raise) the exception.

The only solution I can currently find is to include the Threading library and use the ExceptionEx class that is published in there. That would obviously mean that any one who would like to use my code module need to include the Threading lib as well, even though I don't make use of threading in my code module!!!

Won't it make more sense if the built-in Exception class could be used to throw general exception errors. This makes the code nice and neat because throwing an exception also exits from the current sub / allows you to use try / catch for error handling.

Any comments welcome on this!

Regards,
M. le Roux
 

francoisg

Active Member
Licensed User
Longtime User
Thank you,
might have been a good idea for me to put it in the feature request section in the 1'st place :sign0161:
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…