custom class for exceptions and error logging python code example Example: create custom exception python class CustomError(Exception): pass