deferred.catch(failFilter) adds a handler that runs when the Deferred is rejected (since jQuery 3.0). Officially it is an alias for deferred.then(null, fn) and returns a Promise. Use it for promise-style error handling, just like native Promise.catch.
Build a then/catch chain, then settle the Deferred.
Create a Deferred (or use a jqXHR from $.get / $.ajax).
Chain .then(successFn) for the happy path.
Add .catch(failFn) for rejections and thrown errors.
Settle with resolve() / reject() (or wait for AJAX).
Piece
Required?
Role
Deferred / Promise
Yes
Object that may reject
failFilter
Yes
Function called on rejection
Return
—
Promise (chainable)
Pseudocode
Pseudocode
catch(fn):
return then(null, fn) // official alias
on reject(reason) OR throw in then():
call failFilter(reason)
if failFilter returns value:
next then() can continue (recovered)
if failFilter throws / returns rejected:
chain stays rejected
Reference
Cheat Sheet
Keep these facts handy for Deferred error handling.
Topic
Detail
Syntax
deferred.catch( failFilter )
Alias
deferred.then( null, failFilter )
Runs when
Rejected (or throw / rejected promise in chain)
Success?
Skipped
Returns
Promise
vs fail()
Same idea; catch is promise-style (3.0+)
Since
jQuery 3.0
Try it
Live Preview
Compare reject, success skip, thrown errors, and multi-step propagation.
Browser demo of deferred.catch — same ideas as the examples below.
Result
catch: Network timeout
Code
jQuery Examples
Short, copy-ready snippets (jQuery 3+). Open DevTools Console, or use Try It Yourself for a live editor.
Example 1 — Handle a Rejected Deferred
Register catch(), then reject() with an error message.
Final then skipped. One terminal catch() handles the pipeline.
Edge Cases & Pitfalls
Check these before relying on catch() in chains.
version
Missing on jQuery 1.x / 2.x
catch is jQuery 3.0+. Older code must use fail() or then(null, fn).
success
Skipped on resolve
A successful chain never enters catch(). Put success work in then() / done().
recover
Returning a value recovers
If catch returns a normal value, later then() handlers can run again — intentional recovery.
order
Place catch after the steps you care about
A catch in the middle can swallow an error so later steps still run. Terminal catch is usually clearer.
always
Not a substitute for always()
Catch is error-only. Spinner hide / unlock still belongs in always().
Compatibility
Browser Support
deferred.catch() is part of jQuery’s Deferred API (since 3.0). It works in any browser where jQuery 3.x runs. For jQuery 1.x/2.x, use fail() or then(null, fn).
✓ jQuery 3.0+ · Browsers
jQuery deferred.catch()
Supported in jQuery 3.x across Chrome, Firefox, Safari, Edge, and other browsers with jQuery 3 loaded. Not available in jQuery 1.x / 2.x.
100%With jQuery 3+
Google ChromeAll versions · Desktop & Mobile
Full support
Mozilla FirefoxAll versions · Desktop & Mobile
Full support
Apple SafariAll versions · macOS & iOS
Full support
Microsoft EdgeAll versions · Chromium & Legacy
Full support
Internet ExplorerIE 6+ · Legacy environments
Full support
OperaAll modern versions
Full support
deferred.catch()jQuery 3+
Bottom line: Use catch() on jQuery 3+. On older projects, prefer fail() — same rejection idea, different method name.
Analysis
Performance Notes
Operation
Cost
Best for
catch(fn)
O(1) register
Attaching one rejection handler
Reject + catch
O(n) handlers
Running fail filters in order
Per-step catch
More queues
Prefer one terminal catch unless recovering mid-chain
Registering catch() is cheap. Prefer one terminal catch for a pipeline unless you intentionally recover mid-chain. Keep handlers light — log, map to a user message, or return a fallback value.
Remember
Key Takeaways
Role: handle rejections in a promise-style Deferred chain.
Alias:catch(fn) ≡ then(null, fn).
Throws: errors inside then() also land in catch().
Version: jQuery 3.0+; older code uses fail().
One line:catch() is the modern Deferred rejection hook — same idea as native Promise catch.
Frequently Asked Questions
catch(failFilter) adds a handler that runs when the Deferred is rejected. Officially, deferred.catch(fn) is an alias for deferred.then(null, fn). It returns a Promise.
They both handle rejections. catch() was added in jQuery 3.0 as a Promises/A+-style name and is an alias of then(null, fn). fail() is the classic Deferred API available earlier. Prefer catch() in modern then()-style chains.
No. Successful resolution skips catch(). Only reject, a thrown error in then(), or a rejected promise in the chain triggers it.
catch() was added in jQuery 3.0. On jQuery 1.x or 2.x, use fail() or then(null, fn) instead.
Yes. If the catch handler returns a normal value (or a resolved Deferred), later then() handlers can continue. If it throws or returns a rejected promise, the chain stays rejected.
Use catch() (or fail()) for error-specific logic — messages, retries, fallbacks. Use always() for shared cleanup that runs on both success and failure.