This repository has been archived by the owner on Apr 12, 2024. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix($resource): do not swallow errors in
success
callback
Previously, errors thrown inside the `success` callback would be swallowed by a noop `catch()` handler. The `catch()` handler was added in order to avoid an unnecessary "Possibly Unhandled Rejection" error, in case the user provided an `error` callback (which would handle request errors). The handler was added too "eagrly" and as a result would swallow errors thrown in the `success` callback, despite the fact that those errors would _not_ be handled by the `error` callback. This commit fixes this, by adding the `catch()` handler "lazily", only when it is certain that a rejection will be handled by the `error` callback. Fixes #15624 Closes #15628
- Loading branch information
1 parent
5e418b1
commit 27146e8
Showing
2 changed files
with
80 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters