Get to know MDN better
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
The catch() method of Promise instances schedules a function to be called when the promise is rejected. It immediately returns another Promise object, allowing you to chain calls to other promise methods. It is a shortcut for then(undefined, onRejected).
A function to asynchronously execute when this promise becomes rejected. Its return value becomes the fulfillment value of the promise returned by catch(). The function is called with the following arguments:
reasonThe value that the promise was rejected with.
Returns a new Promise. This new promise is always pending when returned, regardless of the current promise's status. If onRejected is called, the returned promise will resolve based on the return value of this call, or reject with the thrown error from this call. If the current promise fulfills, onRejected is not called and the returned promise fulfills to the same value.
The catch method is used for error handling in promise composition. Since it returns a Promise, it can be chained in the same way as its sister method, then().
If a promise becomes rejected, and there are no rejection handlers to call (a handler can be attached through any of then(), catch(), or finally()), then the rejection event is surfaced by the host. In the browser, this results in an unhandledrejection event. If a handler is attached to a rejected promise whose rejection has already caused an unhandled rejection event, then another rejectionhandled event is fired.
catch() internally calls then() on the object upon which it was called, passing undefined and onRejected as arguments. The value of that call is directly returned. This is observable if you wrap the methods.
This means that passing undefined still causes the returned promise to be rejected, and you have to pass a function to prevent the final promise from being rejected.
Because catch() just calls then(), it supports subclassing.
Note: The examples below are throwing instances of Error. As with synchronous throw statements, this is considered a good practice; otherwise, the part doing the catching would have to perform checks to see if the argument was a string or an error, and you might lose valuable information such as stack traces.
Throwing an error will call the catch() method most of the time:
Errors thrown inside asynchronous functions will act like uncaught errors:
Errors thrown after resolve is called will be silenced:
| ECMAScript® 2027 Language Specification # sec-promise.prototype.catch |
Enable JavaScript to view this browser compatibility table.
This page was last modified on Jul 20, 2025 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.