If you want to add an extra check not provided by argparse
, such as:
if variable a == b then c should be not None
...is it permissible to raise ArgumentError
yourself?
Or, should you raise Exception
instead?
Also what is common practice for this kind of situation? Say that you add a piece of code that's almost like a local extension of the library. Should you use the same exception type(s) as those provided by the library you are extending?