Skip to content

Reject only 5XX errors #27

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

Merged
merged 1 commit into from
Jan 18, 2018
Merged

Conversation

mauchede
Copy link
Contributor

In my previous commit, I added the possibility to reject promise if the response is incorrect. With the possibility, it was possible to manage authentication.

Unfortunately my commit brokes validations: when fetchJsonLd retrieve a 4XX response, it will reject the promise but in fetchHydra, we analyse only resolved promise.

To solve issue api-platform/admin#68, I propose to:

  • reject only 5XX errors or non valid response (same behaviors as fetch).
  • the 4XX responses will be resolved but parsing will fail so the promise will be reject (no change for api-platform/admin).

@mauchede mauchede added the bug label Jan 10, 2018
@mauchede mauchede self-assigned this Jan 10, 2018
@mauchede mauchede requested a review from dunglas January 10, 2018 14:57
@mauchede mauchede merged commit 32509ab into api-platform:master Jan 18, 2018
@mauchede mauchede deleted the fix/validation branch January 18, 2018 10:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants