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
8 changes: 7 additions & 1 deletion ably/util/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,13 @@ def decode_error_response(response):
def from_exception(e):
if isinstance(e, AblyException):
return e
return AblyException(f"Unexpected exception: {e}", 500, 50000)
exc_type = type(e).__name__
exc_msg = str(e)
if exc_msg:
message = f"{exc_type}: {exc_msg}"
else:
message = exc_type
return AblyException(f"Unexpected exception: {message}", 500, 50000)

@staticmethod
def from_dict(value: dict):
Expand Down