From 263568bfde73335ea3236ccec2d79afbe5e6a700 Mon Sep 17 00:00:00 2001 From: Bert Ramirez <13988480+bertrmz@users.noreply.github.com> Date: Wed, 11 Dec 2024 12:47:27 -0600 Subject: [PATCH] chore: add str repr to PassageError class (#120) add str repr to PassageError class --- passageidentity/errors.py | 4 ++++ 1 file changed, 4 insertions(+) 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."""