dbus/python/exceptions.py
John (J5) Palmieri 425257ddf9 * python/Makefile.am: changed to use pyexecdir for the binding
shared libraries (Bug#2494)

* python/exceptions.py: bring exceptions over from the bindings
  so they can be used in applications (Bug#2036)
  Make all exceptions derive from DBusException

* python/_dbus.py, python/proxies.py: implement __repr__ in a couple
  of classes so that print obj doesn't throw an exception (Bug #1685)
2005-05-05 18:01:45 +00:00

21 lines
819 B
Python

import dbus_bindings
DBusException = dbus_bindings.DBusException
ConnectionError = dbus_bindings.ConnectionError
class MissingErrorHandlerException(DBusException):
def __init__(self):
DBusException.__init__(self, "error_handler not defined: if you define a reply_handler you must also define an error_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(DBusException):
def __init__(self, msg=''):
DBusException.__init__(self, "Error validating string: %s"%msg)
class UnknownMethodException(DBusException):
def __init__(self, msg=''):
DBusException.__init__("Unknown method: %s"%msg)