Skip to content

Commit bc3bfb3

Browse files
minor tweaks
1 parent 5cd1315 commit bc3bfb3

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

sentry_sdk/utils.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -713,17 +713,21 @@ def get_errno(exc_value):
713713

714714
def get_error_message(exc_value):
715715
# type: (Optional[BaseException]) -> str
716-
value = (
716+
message = (
717717
getattr(exc_value, "message", "")
718718
or getattr(exc_value, "detail", "")
719719
or safe_str(exc_value)
720720
) # type: str
721721

722+
# __notes__ should be a list of strings when notes are added
723+
# via add_note, but can be anything else if __notes__ is set
724+
# directly. We only support strings in __notes__, since that
725+
# is the correct use.
722726
notes = getattr(exc_value, "__notes__", None) # type: object
723727
if isinstance(notes, list) and len(notes) > 0:
724-
value += "\n" + "\n".join(note for note in notes if isinstance(note, str))
728+
message += "\n" + "\n".join(note for note in notes if isinstance(note, str))
725729

726-
return value
730+
return message
727731

728732

729733
def single_exception_from_error_tuple(

0 commit comments

Comments
 (0)