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

Add an 'onError' handler #51

Merged
merged 1 commit into from
Sep 13, 2018
Merged

Conversation

pgengler
Copy link
Contributor

This add an onError hook that can be used to do something if the request fails (it's optional, and by default just contains the existing "on error" logic of logging the error in non-test environments).

(The real-world use case for this is to be able to tell when the endpoint response is a 403, usually meaning the user's session has expired, so we can redirect them back to the login page without the user having to try to perform some action first.)

@knownasilya knownasilya merged commit 1a491c9 into sethwebster:master Sep 13, 2018
@knownasilya
Copy link
Collaborator

Thanks @pgengler!

@knownasilya
Copy link
Collaborator

Published as v1.4.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants