diff options
Diffstat (limited to 'python/exceptions.py')
-rw-r--r-- | python/exceptions.py | 35 |
1 files changed, 12 insertions, 23 deletions
diff --git a/python/exceptions.py b/python/exceptions.py index 66b8c566..b9df8150 100644 --- a/python/exceptions.py +++ b/python/exceptions.py @@ -1,32 +1,21 @@ -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" +import dbus_bindings +DBusException = dbus_bindings.DBusException +ConnectionError = dbus_bindings.ConnectionError -class MissingReplyHandlerException(Exception): +class MissingErrorHandlerException(DBusException): def __init__(self): - Exception.__init__(self) + DBusException.__init__(self, "error_handler not defined: if you define a reply_handler you must also define an error_handler") - def __str__(self): - return "reply_handler not defined: if you define an error_handler you must also define a reply_handler" +class MissingReplyHandlerException(DBusException): + def __init__(self): + DBusException.__init__(self, "reply_handler not defined: if you define an error_handler you must also define a reply_handler") -class ValidationException(Exception): +class ValidationException(DBusException): def __init__(self, msg=''): - self.msg = msg - Exception.__init__(self) - - def __str__(self): - return "Error validating string: %s" % self.msg + DBusException.__init__(self, "Error validating string: %s"%msg) -class UnknownMethodException(Exception): +class UnknownMethodException(DBusException): def __init__(self, msg=''): - self.msg = msg - Exception.__init__(self) - - def __str__(self): - return "Unknown method: %s" % self.msg + DBusException.__init__("Unknown method: %s"%msg) |