Proper way to declare custom exceptions in modern Python?
Maybe I missed the question, but why not: class MyException(Exception): pass To override something (or pass extra args), do this: class ValidationError(Exception): def __init__(self, message, errors): # Call the base class constructor with the parameters it needs super().__init__(message) # Now for your custom code… self.errors = errors That way you could pass dict of error … Read more