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

Improve handling of error responses from the API #327

Merged
merged 1 commit into from May 8, 2020
Merged

Improve handling of error responses from the API #327

merged 1 commit into from May 8, 2020

Conversation

spiritualized
Copy link

Fixes #

Changes proposed in this pull request:

  • Raise a WSError if the API response contains a non-200 code, instead of failing to interpret the body and raising a MalformedResponseError

@spiritualized
Copy link
Author

@hugovk, will you accept this change?

I'm not getting the test failures locally, perhaps there's a problem with the configured password or API key.

@hugovk
Copy link
Member

hugovk commented May 5, 2020

Yeah, tests fail for PRs due to #171.

I was wondering, not every non-200 status is an error. For example, could there be 3xx redirect statuses? How about other statuses?

@spiritualized
Copy link
Author

Good point. Altered the check to only catch relevant 5xx errors.

@hugovk hugovk added the changelog: Changed For changes in existing functionality label May 8, 2020
@hugovk hugovk merged commit 2aaa594 into pylast:master May 8, 2020
@hugovk
Copy link
Member

hugovk commented May 8, 2020

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog: Changed For changes in existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants