You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 22, 2025. It is now read-only.
Kris Kowal edited this page Jun 19, 2013
·
4 revisions
There’s an interesting thing about error handling with promises: it is
easy to isolate error sources. Consider the following anti-pattern. It is
common for a programmer to capture more exceptions than they intend.
There is a tension here. The programmer only wants to proceed if an exception
is not thrown, but they also only want to catch the syntax error. The
following, far more verbose, example appropriately isolates the syntax error.
With our promise library, error isolation is inherent to the system. The error
handler applies only to the given promise and does not catch an exception
thrown in the fulfillment handler.