Skip to content

Add an 'onError' handler - #51

Merged
knownasilya merged 1 commit into
sethwebster:masterfrom
pgengler:error-hook
Sep 13, 2018
Merged

Add an 'onError' handler#51
knownasilya merged 1 commit into
sethwebster:masterfrom
pgengler:error-hook

Conversation

@pgengler

Copy link
Copy Markdown
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
Copy Markdown
Collaborator

Thanks @pgengler!

@knownasilya

Copy link
Copy Markdown
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