Skip to content

Commit

Permalink
Replace UserWarning with AuthenticationError
Browse files Browse the repository at this point in the history
This is a more accurate error for what is actually happening and lets us
save the actual response in case the user wants to do something with it.
  • Loading branch information
XanderRiga committed Feb 15, 2021
1 parent 1674fa9 commit 596cfb6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pyracing/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
session_data,
upcoming_events,
)
from .exceptions.authentication_error import AuthenticationError

from datetime import datetime
import httpx
Expand Down Expand Up @@ -61,7 +62,7 @@ async def _authenticate(self):
'indicating an authentication failure. If credentials are '
'correct, check that a captcha is not required by manually '
'visiting members.iracing.com')
raise UserWarning(auth_response.read())
raise AuthenticationError('Login Failed', auth_response)
else:
logger.info('Login successful')

Expand Down

0 comments on commit 596cfb6

Please sign in to comment.