Skip to content

Commit

Permalink
add str repr to PassageError class
Browse files Browse the repository at this point in the history
  • Loading branch information
bertrmz committed Dec 11, 2024
1 parent 7084ec3 commit bbe7d0f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions passageidentity/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ def __init__(
self.error = body["error"]
self.error_code = body["code"]

def __str__(self) -> str:
"""Return the error message."""
return self.message

@classmethod
def from_response_error(cls, response_error: ApiException, message: str | None = None) -> PassageError:
"""Initialize the error with a response body and optional message."""
Expand Down

0 comments on commit bbe7d0f

Please sign in to comment.