loading...

re: All (or just most) of what you need to know about handling Promises VIEW POST

TOP OF THREAD FULL DISCUSSION
re: Not sure what you mean. You just removed the .catch(), which means you do not handle in case of rejection.
 

You can chain the Promises. Inside of .then(), you can return another promise and it'll let you add another .then() underneath. You add a single .catch() at very end, which will work for all the .then() chains.

longPromise()
    .then((data)=>{
        console.log(data); // logs: longPromise resolved
        return shortPromise();
    .then((data)=>{
        console.log(data) // logs: shortPromise resolved
    })
    .catch((error)=> {
         console.log(error);
    })
});
code of conduct - report abuse