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

Force user to opt in to receiving a thrown error #151

Open
chawes13 opened this issue Nov 24, 2021 · 0 comments
Open

Force user to opt in to receiving a thrown error #151

chawes13 opened this issue Nov 24, 2021 · 0 comments
Labels

Comments

@chawes13
Copy link
Contributor

chawes13 commented Nov 24, 2021

Since apiActions created via createRequest are typically handled in the reducer (via handleSuccess, handleFailure, or handleResponse), we usually do not add .catch() statements to each individual call that is mapped to dispatch as a prop. This results in some confusing console error message when a call fails (see LaunchPadLab/lp-requests#87).

Given that the default behavior is to not handle this error, I'm wondering if we should include an option that either:

  • Returns the error (but doesn't throw it); or
  • Ignores the error (after calling failureAction and onUnauthorized)

An option could be failSilently or ignoreError? Need to do a bit of research about best practices / conventions.

@chawes13 chawes13 added the idea label Nov 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant