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

Split up application error handling #3184

Merged
merged 10 commits into from
Dec 11, 2021
Merged

Conversation

askvortsov1
Copy link
Sponsor Member

Fixes #2742

  • Use a catch instead of a then with a vacuous onfulfilled
  • Instead of setting a default errorHandler that throws the error, just run the fallback handler if no error handler is explicitly provided
  • Split requestErrorCatch and requestErrorDefaultHandler into separate methods.
  • Clean up some messy duplicate code with formattedErrors and content on 422 errors
  • Properly typehint AlertAttrs

@askvortsov1 askvortsov1 requested review from dsevillamartin, davwheat and SychO9 and removed request for dsevillamartin December 1, 2021 22:04
js/src/common/utils/RequestError.ts Outdated Show resolved Hide resolved
Co-authored-by: David Wheatley <hi@davwheat.dev>
@askvortsov1 askvortsov1 merged commit 57b413a into master Dec 11, 2021
@askvortsov1 askvortsov1 deleted the as/avoid-ambiguous-error branch December 11, 2021 17:32
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.

Allow extending XHR response error handling globally
4 participants