Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions dbus_next/message_bus.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down