diff --git a/passageidentity/errors.py b/passageidentity/errors.py index 57cf4d5..7c959e2 100644 --- a/passageidentity/errors.py +++ b/passageidentity/errors.py @@ -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."""