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}")