From d6af05038d9336c78abee29f134c4650de60e715 Mon Sep 17 00:00:00 2001 From: Phong Nguyen <93941060+andyj29@users.noreply.github.com> Date: Fri, 28 Oct 2022 14:23:24 -0400 Subject: [PATCH] updated HTTPError, OktaAPIError to call Error base class constructor --- okta/errors/error.py | 4 ++-- okta/errors/http_error.py | 2 +- okta/errors/okta_api_error.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/okta/errors/error.py b/okta/errors/error.py index 09a39194..9f24f4d4 100644 --- a/okta/errors/error.py +++ b/okta/errors/error.py @@ -3,8 +3,8 @@ class Error: Base Error Class """ - def __init__(self): - self.message = "" + def __init__(self, message): + self.message = message def __repr__(self): return str({ diff --git a/okta/errors/http_error.py b/okta/errors/http_error.py index 86afb642..b1865ccb 100644 --- a/okta/errors/http_error.py +++ b/okta/errors/http_error.py @@ -7,4 +7,4 @@ def __init__(self, url, response_details, response_body): self.url = url self.response_headers = response_details.headers self.stack = "" - self.message = f"HTTP {self.status} {response_body}" + super().__init__(f"HTTP {self.status} {response_body}") diff --git a/okta/errors/okta_api_error.py b/okta/errors/okta_api_error.py index 65ab2237..b0557b75 100644 --- a/okta/errors/okta_api_error.py +++ b/okta/errors/okta_api_error.py @@ -17,5 +17,5 @@ def __init__(self, url, response_details, response_body): self.headers = response_details.headers self.stack = "" - self.message = (f"Okta HTTP {self.status} {self.error_code} " - f"{self.error_summary}\n{error_causes_string}") + super().__init__(f"Okta HTTP {self.status} {self.error_code} " + f"{self.error_summary}\n{error_causes_string}")