Is there an easier/proper way for when a promise error's for it to bubble up to when it is called in a second promise without having to reject the promise in it's catch block each time manually?
promise1() {
return this.$http
.get("/url")
.then(response => {
// do things
})
.catch(err => {
return Promise.reject(err);
// don't want to have to call this in every single catch block
// ideally errors would bubble up when called from second promise
});
}
In a second promise, I want the catch block to be triggered when the first promise fails (and not having to manually reject it)
promise2(){
return .promise1()
.then(response => {})
.catch(err => {
// error bubbled up from first promise
}
});
}