Skip to content

Commit

Permalink
lol snake case
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulAsjes committed Sep 9, 2024
1 parent 0ac2c98 commit 4ee8ddf
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions workos/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ def __init__(
self.response = response
self.response_json = response_json

self.message = self.extractFromJson("message", "No message")
self.error = self.extractFromJson("error", "Unknown")
self.errors = self.extractFromJson("errors", None)
self.code = self.extractFromJson("code", None)
self.error_description = self.extractFromJson("error_description", "Unknown")
self.message = self.extract_from_json("message", "No message")
self.error = self.extract_from_json("error", "Unknown")
self.errors = self.extract_from_json("errors", None)
self.code = self.extract_from_json("code", None)
self.error_description = self.extract_from_json("error_description", "Unknown")

self.request_id = response.headers.get("X-Request-ID")

def extractFromJson(self, key: str, alt: Optional[str] = None) -> Optional[str]:
def extract_from_json(self, key: str, alt: Optional[str] = None) -> Optional[str]:
if self.response_json is None:
return alt

Expand Down

0 comments on commit 4ee8ddf

Please sign in to comment.