-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
sendEIAToProxy is called, even if importKey has failed. (If this is intended behaviour, just ignore this issue :).) Thats because the first error handler returns undefined, which ends up in a resolved promise being returned at the end of line 97, which leads to execution of success handler (sendEIAToProxy).
Line 98 in 7bc29bc
| .then(sendEIAToProxy, (x) => { console.log('Error encrypting IA!', x); }); |
To mitigate this, you could:
- use
.catch(errorHandler)(not Promise/A+ compliant) .then(null, errorHandler)
at the end of the then chain.
One line of code tells more than any prosa:
Promise.reject("some err").then(null, (...a)=>console.log("errhandler1", ...a)).then((...a)=>console.log("success2", ...a), (...a)=>console.log("errhandler2", ...a))
Its recommended to always have a final error handler at the end. This prevents possibly uncaught promise rejections.
Metadata
Metadata
Assignees
Labels
No labels