diff --git a/okta/errors/error.py b/okta/errors/error.py index 9f24f4d4..09a39194 100644 --- a/okta/errors/error.py +++ b/okta/errors/error.py @@ -3,8 +3,8 @@ class Error: Base Error Class """ - def __init__(self, message): - self.message = message + def __init__(self): + self.message = "" def __repr__(self): return str({ diff --git a/okta/errors/http_error.py b/okta/errors/http_error.py index b1865ccb..86afb642 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 = "" - super().__init__(f"HTTP {self.status} {response_body}") + self.message = f"HTTP {self.status} {response_body}" diff --git a/okta/errors/okta_api_error.py b/okta/errors/okta_api_error.py index b0557b75..65ab2237 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 = "" - super().__init__(f"Okta HTTP {self.status} {self.error_code} " - f"{self.error_summary}\n{error_causes_string}") + self.message = (f"Okta HTTP {self.status} {self.error_code} " + f"{self.error_summary}\n{error_causes_string}") diff --git a/okta/jwt.py b/okta/jwt.py index 3a9c77ee..b30e5547 100644 --- a/okta/jwt.py +++ b/okta/jwt.py @@ -58,10 +58,10 @@ def get_PEM_JWK(private_key): # check if JWK # String representation of dictionary or dict - if ((type(private_key) == str and private_key.startswith("{")) or - type(private_key) == dict): + if ((isinstance(private_key, str) and private_key.startswith("{")) or + isinstance(private_key, dict)): # if string repr, convert to dict object - if (type(private_key) == str): + if isinstance(private_key, str): private_key = literal_eval(private_key) # Create JWK using dict obj my_jwk = jwk.construct(private_key, JWT.HASH_ALGORITHM)