From 19c3c06ba19cf91ea7c0fd45ac669de921601a8a Mon Sep 17 00:00:00 2001 From: spwoodcock Date: Mon, 8 Apr 2024 18:36:52 +0100 Subject: [PATCH] fix: replace pydantic ValidationError with ValueError --- osm_login_python/core.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/osm_login_python/core.py b/osm_login_python/core.py index 3479887..00fc630 100644 --- a/osm_login_python/core.py +++ b/osm_login_python/core.py @@ -6,7 +6,6 @@ from itsdangerous import BadSignature, SignatureExpired from itsdangerous.url_safe import URLSafeSerializer -from pydantic import ValidationError from requests_oauthlib import OAuth2Session from . import Login, Token @@ -103,6 +102,6 @@ def deserialize_access_token(self, access_token: str) -> dict: user_data = deserializer.loads(decoded_token) except (SignatureExpired, BadSignature) as e: log.error(e) - raise ValidationError("Invalid token") from e + raise ValueError("Auth token is invalid or expired") from e return user_data