From 5825f75ab994e264559f241c22ef262d7dbc9fe3 Mon Sep 17 00:00:00 2001 From: Martin Musale Date: Mon, 11 Sep 2023 20:48:59 +0300 Subject: [PATCH] Use getattr inbuilt with a default empty string Signed-off-by: Martin Musale --- kiota_abstractions/api_error.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/kiota_abstractions/api_error.py b/kiota_abstractions/api_error.py index fbb40ce..d90aef6 100644 --- a/kiota_abstractions/api_error.py +++ b/kiota_abstractions/api_error.py @@ -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', '')}"""