Errors

Implementations of custom errors

source

MyException

 MyException (message)

Common base class for all non-exit exceptions.

try:
    x = float('kjsd')
except MyException('custom error') as e:
    print(e)
#     raise MyException("cannot divide by zero")
TypeError: catching classes that do not inherit from BaseException is not allowed