code: def extract_error_message(error):
      
      try:
          return error.description or error.__class__.__name__
      except AttributeError:
          try:
              return str(error.message) or error.__class__.__name__
          except AttributeError:
              return str(error) or error.__class__.__name__
docs: Extract a useful message from an error.
  
      Prefer the description attribute, then the message attribute, then
      the errors string conversion. In each case, fall back to the error class's
      name in the event that the attribute value was set to a uselessly empty string.