Rename dbus_bindings (sometimes a.k.a. dbus.dbus_bindings) to _dbus_bindings.
[dbus-python-phuang.git] / dbus / exceptions.py
blob60ba3fd121ff0b5fdb87e4d7cb2270b3cfb86afd
1 """D-Bus exceptions."""
3 __all__ = ('DBusException', 'ConnectionError', 'MissingErrorHandlerException',
4 'MissingReplyHandlerException', 'ValidationException',
5 'IntrospectionParserException', 'UnknownMethodException',
6 'NameExistsException')
8 import _dbus_bindings
10 DBusException = _dbus_bindings.DBusException
11 ConnectionError = _dbus_bindings.ConnectionError
13 class MissingErrorHandlerException(DBusException):
14 def __init__(self):
15 DBusException.__init__(self, "error_handler not defined: if you define a reply_handler you must also define an error_handler")
17 class MissingReplyHandlerException(DBusException):
18 def __init__(self):
19 DBusException.__init__(self, "reply_handler not defined: if you define an error_handler you must also define a reply_handler")
21 class ValidationException(DBusException):
22 def __init__(self, msg=''):
23 DBusException.__init__(self, "Error validating string: %s"%msg)
25 class IntrospectionParserException(DBusException):
26 def __init__(self, msg=''):
27 DBusException.__init__(self, "Error parsing introspect data: %s"%msg)
29 class UnknownMethodException(DBusException):
30 def __init__(self, method):
31 DBusException.__init__(self, "Unknown method: %s"%method)
33 class NameExistsException(DBusException):
34 def __init__(self, name):
35 DBusException.__init__(self, "Bus name already exists: %s"%name)