Skip to content

Commit

Permalink
Merge pull request #134 from musale/apierror-str
Browse files Browse the repository at this point in the history
Use `getattr` inbuilt with a default empty string
  • Loading branch information
samwelkanda authored Sep 12, 2023
2 parents 3f1b157 + 5825f75 commit 64bfef7
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions kiota_abstractions/api_error.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@ class APIError(Exception):
response_headers: Optional[Dict[str, str]] = None

def __str__(self) -> str:
return f"""APIError {self.response_status_code}: {self.message} {self.__getattribute__(
'error')}"""
return f"""APIError {self.response_status_code}: {self.message} {getattr('error', '')}"""

0 comments on commit 64bfef7

Please sign in to comment.