Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

503 responses throw Steam::JSONError #8

Open
thomas-mcdonald opened this issue Dec 23, 2016 · 1 comment
Open

503 responses throw Steam::JSONError #8

thomas-mcdonald opened this issue Dec 23, 2016 · 1 comment
Assignees

Comments

@thomas-mcdonald
Copy link

Filing a ticket to track - happy to work on a PR for this.

The Steam API is currently down (along with the rest of Steam). The API responds with a HTML file when this happens:

Service Unavailable

The server is temporarily unable to service your request. Please try again later.
Reference #6.857ffea5.1482516293.3b52a0f

Naturally, this throws a JSON parsing error - since it's definitely not JSON:

Steam::JSONError: The API returned an unexpected JSON response

It would be nice if we could special case a 503 response and throw a Steam::UnavailableError or something similar - would be able to disambiguate between bad JSON responses (e.g. a game with no achievements returns an invalid JSON block) vs the service is down (returns 503 page).

@thomas-mcdonald thomas-mcdonald changed the title 503 responses could be handled nicer 503 responses throw Steam::JSONError Dec 23, 2016
@bhaberer
Copy link
Owner

Sounds like a good idea, thanks for the report.

@bhaberer bhaberer self-assigned this Jan 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants