https://docs.python.org/3/tutorial/errors.html#tut-userexceptions
Programs may name their own exceptions by creating a new exception class. Exceptions should typically be derived from the 'Exception' class, either directly or indirectly.
All exceptions must be instances of a class that derives from 'BaseException'.
# Syntax.
class SomeError(Exception): # a name with 'Error' if we want to raport errors
docstring # optional
statements
class MyError(Exception):
pass # the default __init__() is used
raise MyError("message") # raising the exception
exception = MyError("a", "b") # creating an instance of the exception class
print(exception.args) # ('a', 'b'), the tuple is created by the constructor
print(exception) # ('a', 'b'), str() uses exception.args