Closed

Description
Essentially, Promise.prototype.then
allows taking in two arguments to respond to both resolved and rejected promises. Essentially, p.then(f, g)
is equivalent to p.catch(g).then(f)
; note that the catch comes first since errors thrown by the then
handler are not caught by the catch
handler.
It would be nice to automatically replace instances like this since it makes it easier to visually scan for catch
to check if an error is handled. It also helps emphasise the fact that the then
is not handled by the catch
, which isn't as apparent when it's ordered visually after the then
handler.