AdrianJSClark / aydsko-iracingdata

A .NET access library for querying the iRacing "Data" API.
MIT License
29 stars 8 forks source link

Improve Maintenance Period Handling #149

Closed AdrianJSClark closed 1 year ago

AdrianJSClark commented 1 year ago

During an iRacing maintenance period an attempt to authenticate initially will fail with a "503 - Service Unavailable" HTTP error. This wasn't properly handled in the login method, as it would attempt to deserialize a JSON payload, when the error contained a HTML body

Assume when we see 503 that the service is in maintenance. For all other failures, return the generic login failed exception.