Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function someFunction() {
- return fn().then(val => {
- // do something here when promise resolves
- return someVal;
- }).catch(err => {
- // do something here when promise rejects
- console.log(err);
- // throw the error to keep the returned promise rejected
- throw err;
- });
- }
Add Comment
Please, Sign In to add comment