Skip to content

Commit

Permalink
fix: replace pydantic ValidationError with ValueError
Browse files Browse the repository at this point in the history
  • Loading branch information
spwoodcock committed Apr 8, 2024
1 parent dcb5467 commit 19c3c06
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions osm_login_python/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

0 comments on commit 19c3c06

Please sign in to comment.