Skip to content

Commit

Permalink
Use getattr inbuilt with a default empty string
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Musale <[email protected]>
  • Loading branch information
musale committed Sep 11, 2023
1 parent 3f1b157 commit 5825f75
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 5825f75

Please sign in to comment.