How to write custom Python Exceptions with Error Codes and Error Messages?
I have an application App with error codes and error messages like this in the code below.
class AppError(Exception): pass
class BlahBlahError(AppError):
# definition of the error codes & messages
messerr = {101: " Certain error here. Please verify.", \
102: “Another one here. Please verify.", \
103: "One more here. Please verify.", \
104: "That was a bloomer!. Please verify."}
How do I write custom python exceptions with error codes and error messages?