diff --git a/dbus_next/message_bus.py b/dbus_next/message_bus.py index 0cfe5dd..533d97a 100644 --- a/dbus_next/message_bus.py +++ b/dbus_next/message_bus.py @@ -561,15 +561,17 @@ def __call__(self, reply): bus.send(reply) def __exit__(self, type, value, tb): - if type == DBusError: + if issubclass(type, DBusError): self(value._as_message(msg)) + return True - if type == Exception: + if issubclass(type, Exception): self( Message.new_error( msg, ErrorType.SERVICE_ERROR, f'The service interface raised an error: {value}.\n{traceback.format_tb(tb)}' )) + return True return SendReply()