errorCaptured Capture Descendant Errors
Last updated: 2026-10-22
errorCaptured Capture Descendant Errors
errorCaptured catches errors from descendant components; returning false stops propagation to the global handler.
| Group | Options: Rendering & Lifecycle |
|---|---|
| Kind | Option |
| Scope | Component |
| Vue Version | 3.0+ |
| SSR Support | Yes |
📝 Syntax
export default {
errorCaptured(err, vm, info) {
return false // stop propagation
}
}
⚙️ Arguments
| value | err, vm and an info string describing the source |
|---|
Returns:Return false to stop propagation
▶ Example
Edit the code below and see the live result:
Output:
Shows 'caught: child failed to initialise' without a blank screen.
💡 Key Points
💡 Tip Capture at the top and report to monitoring.
⚠️ Warning Synchronous errors only — handle promise rejections yourself.
ℹ️ Note Errors bubble up to the nearest boundary first.
🏷️ Related Rendering & Lifecycle
💡 Related Cases
More case studies coming soon.
📚 Related Tutorials
❓ FAQ
Q Can it catch async errors?
A No — synchronous ones only.
Q Relation to the global errorHandler?
A Return false to stop it locally; otherwise it reaches the global handler.
Q How to build fallback UI?
A Set state on capture and switch to a fallback view with v-if.