Skip to content

Commit c68c3d6

Browse files
fix: Cast message and detail attributes before appending exception notes (#5114)
Cast `message` and `detail` attributes on exceptions to string before generating the `value` of the Sentry exception. Prevents an unhandled `TypeError` when these attributes are `bytes`, as `get_error_message()` attempts to append string exception notes. Resolves the exception described in #5050.
1 parent 14aff96 commit c68c3d6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sentry_sdk/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -654,7 +654,7 @@ def get_errno(exc_value):
654654

655655
def get_error_message(exc_value):
656656
# type: (Optional[BaseException]) -> str
657-
message = (
657+
message = safe_str(
658658
getattr(exc_value, "message", "")
659659
or getattr(exc_value, "detail", "")
660660
or safe_str(exc_value)

0 commit comments

Comments
 (0)