You want to create a custom exception ValidationError that stores an error code along with the message. Which code correctly implements this?
Aclass ValidationError(Exception):
def __init__(self, message):
self.code = 0
super().__init__(message)
Bclass ValidationError(Exception):
def __init__(self, message, code):
self.message = message
self.code = code
Cclass ValidationError(Exception):
def __init__(self, code):
super().__init__(code)
Dclass ValidationError(Exception):
def __init__(self, message, code):
super().__init__(message)
self.code = code