-
Notifications
You must be signed in to change notification settings - Fork 47
Open
Description
In executeAsyncOperation the promise rejection scenario is not properly handled. It captures the error, saves it in state, but then it propagates further and causes exceptions in the codebase. I suggest to change the implementation to this
return promise
.then((result) => {
if (shouldHandlePromise(promise)) {
AsyncState.setResult(result);
}
normalizedOptions.onSuccess(result, {
isCurrent: () => CurrentPromise.is(promise),
});
})
.catch((error) => {
if (shouldHandlePromise(promise)) {
AsyncState.setError(error);
}
normalizedOptions.onError(error, {
isCurrent: () => CurrentPromise.is(promise),
});
});instead of
promise.then(() => {}, () => {});damienromito, ChrisLincoln, slek22 and whollacsek
Metadata
Metadata
Assignees
Labels
No labels