.catch()callback can throw a new error, but if it returns normally, than that return value is used to resolve (fulfill) the associated Promise, and the error stops propagating.
// recover from errorsasyncOperation().then(doStage2)// ⭐️ catch recoverable errors from stage 2// ---------------------------------------------------------// if `recoverableErrors` returns normally, its return value// is passed to `doStage3` and continues normally..catch(recoverableErrors) .then(doStage3) .then(doStage4) .catch(stage3And4Errors);// recover from network problemsqueryDatabase() // ⭐️ wait and retry (`wait` is fictional).catch(e =>wait(500).then(queryDatabase)).then(displayTable) .catch(displayDatabaseError);