doc/tutorial.txt.in: Add copyright and license (GPL2/AFL2.1, like the code)
[dbus-python-phuang.git] / dbus / exceptions.py
blob801ede6388856e0a2bb9bdf1c0e5c66f103e305e
1 """D-Bus exceptions."""
3 __all__ = ('DBusException', 'MissingErrorHandlerException',
4 'MissingReplyHandlerException', 'ValidationException',
5 'IntrospectionParserException', 'UnknownMethodException',
6 'NameExistsException')
8 import _dbus_bindings
10 DBusException = _dbus_bindings.DBusException
12 class MissingErrorHandlerException(DBusException):
13 def __init__(self):
14 DBusException.__init__(self, "error_handler not defined: if you define a reply_handler you must also define an error_handler")
16 class MissingReplyHandlerException(DBusException):
17 def __init__(self):
18 DBusException.__init__(self, "reply_handler not defined: if you define an error_handler you must also define a reply_handler")
20 class ValidationException(DBusException):
21 def __init__(self, msg=''):
22 DBusException.__init__(self, "Error validating string: %s"%msg)
24 class IntrospectionParserException(DBusException):
25 def __init__(self, msg=''):
26 DBusException.__init__(self, "Error parsing introspect data: %s"%msg)
28 class UnknownMethodException(DBusException):
29 def __init__(self, method):
30 DBusException.__init__(self, "Unknown method: %s"%method)
32 class NameExistsException(DBusException):
33 def __init__(self, name):
34 DBusException.__init__(self, "Bus name already exists: %s"%name)