New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prefer calling then
and catch
separately to combining them into a single then
#217
Comments
Are you proposing to keep them separate AND to order them. Maybe that would be a config option. I'm not necessarily sold on the ordering thing. |
To clarify, I mean that |
Essentially,
Promise.prototype.then
allows taking in two arguments to respond to both resolved and rejected promises. Essentially,p.then(f, g)
is equivalent top.catch(g).then(f)
; note that the catch comes first since errors thrown by thethen
handler are not caught by thecatch
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 thethen
is not handled by thecatch
, which isn't as apparent when it's ordered visually after thethen
handler.The text was updated successfully, but these errors were encountered: