diff options
Diffstat (limited to 'python/exceptions.py')
-rw-r--r-- | python/exceptions.py | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/python/exceptions.py b/python/exceptions.py new file mode 100644 index 00000000..66b8c566 --- /dev/null +++ b/python/exceptions.py @@ -0,0 +1,32 @@ +class MissingErrorHandlerException(Exception): + def __init__(self): + Exception.__init__(self) + + + def __str__(self): + return "error_handler not defined: if you define a reply_handler you must also define an error_handler" + + +class MissingReplyHandlerException(Exception): + def __init__(self): + Exception.__init__(self) + + def __str__(self): + return "reply_handler not defined: if you define an error_handler you must also define a reply_handler" + +class ValidationException(Exception): + def __init__(self, msg=''): + self.msg = msg + Exception.__init__(self) + + def __str__(self): + return "Error validating string: %s" % self.msg + +class UnknownMethodException(Exception): + def __init__(self, msg=''): + self.msg = msg + Exception.__init__(self) + + def __str__(self): + return "Unknown method: %s" % self.msg + |