Designing Custom Exception Classes in Python
It isn't wonderfully well documented in Python that the
Exception class takes any number of positional arguments (pargs) and uses them to provide
__repr__() methods and pickling support. If you understand how
Exception's pargs work then you can use it as a base
class correctly and inherit these features for your custom exception classes.