File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -713,17 +713,21 @@ def get_errno(exc_value):
713713
714714def 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
729733def single_exception_from_error_tuple (
You can’t perform that action at this time.
0 commit comments