Throw more specific exceptions
psynaptic opened this issue · comments
Richard Burford commented
Great library. Thanks for your work on this.
Instead of just throwing Exception when something goes wrong, it would be more useful to throw more meaningful exceptions so they can be caught and appropriately handled.
Some examples:
MissingValueException
Uncaught exception 'Exception' with message 'Option f require a value.'
InvalidOptionException
Uncaught exception 'Exception' with message 'Invalid option: -q'
I see that there is already NonNumericException. This would just be to flesh-out the support for more specific exceptions.
c9s commented
Yeah, totally agree, we should do that.
c9s commented
Newly added exceptions:
RequireValueException
InvalidOptionException