Promise.reject('api error')
.catch(null)
.then(() => console.log('1'))
.catch((err) => console.log(err))
.then(() => console.log('2'))api error
2
Promise { <state>: "fulfilled", <value>: undefined }Promise { <state>: "rejected", <reason>: 'api error' }Promise.reject('api error').catch((err) => console.log(err))api error
Promise {<fulfilled>: undefined} catch(onRejected)
Returns a new Promise. This new promise is always pending when returned, regardless of the current promise's status. It's eventually rejected if onRejected throws an error or returns a Promise which is itself rejected; otherwise, it's eventually fulfilled.
.catch(null) не работает, поскольку не указана функция onRejected..catch возвращает Promise.fulfilled, согласно спецификации.