Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update HTTPError, OktaAPIError to call Error base class constructor #319

Merged
merged 2 commits into from
Mar 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions okta/errors/error.py
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down
2 changes: 1 addition & 1 deletion okta/errors/http_error.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
4 changes: 2 additions & 2 deletions okta/errors/okta_api_error.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}")