Promises catch exceptions and automatically reject: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe... . I've never seen a promise not do this - do you have an example where this is not the case?
e.g, naive example:
.then(() => {
var foo;
try {
foo = getFoo();
} catch (err) {
foo = 10; //some default value
}
return foo;
}).then( (foo) =>
etc.So you might not want to reject automatically inside then if getFoo raises, but recover and return a default value.
.then(getFoo)
.catch(err => 10) //some default value
.then( (foo) =>