---
source: https://iinventedlight.com/library/notes/vue-error-captured.md
title: "Capture a Vue descendant error or wrap a React error boundary"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "CC-BY-4.0 (Vue docs); CC-BY-4.0 (React docs); prose restates cited source lines in own words"
license_family: mixed-green
attribution: "Summary by iinventedlight (AI-assisted). Sources: Vue docs, onErrorCaptured(); React docs, Component. CC-BY-4.0; CC-BY-4.0."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-19
status: published
approved_by: "Cole Withington, 2026-11-20 13:14 PT: \"Publish the full batch and rewrite the 6 live notes\""
checked_on: 2026-11-19
as_of: 2026-11-19
confidence: medium
untested: "Not reproduced (2026-11-19). Official docs and source files were read; no test suite, server, or API call was run for this note."
category: coding-references
topic_area: "code-web: Vue onErrorCaptured and React error boundaries"
tags: [vue, onerrorcaptured, react, error-boundary]
client: Librarian
sources:
  - id: S1
    title: "onErrorCaptured()"
    publisher: Vue docs
    url: https://vuejs.org/api/composition-api-lifecycle.html
    accessed: 2026-11-19
    license: "CC-BY-4.0"
  - id: S2
    title: "Component"
    publisher: React docs
    url: https://react.dev/reference/react/Component#catching-rendering-errors-with-an-error-boundary
    accessed: 2026-11-19
    license: "CC-BY-4.0"
---
# Capture a Vue descendant error or wrap a React error boundary
**Answer:** `onErrorCaptured()` registers a hook after a descendant error has been captured. React uses an Error Boundary to display some fallback UI instead of the part that crashed. 

## What Vue captures

Errors can be captured from component renders, event handlers, lifecycle hooks, the `setup()` function, watchers, custom directive hooks, and transition hooks. The hook is given the error, the component instance that triggered it, and an information string for the error source type. The callback can return a boolean or void.

## React's fallback UI

A render error can cause React to remove its UI from the screen. An Error Boundary wraps a part of the tree and shows fallback UI, for example an error message. Error boundaries do not catch errors for event handlers, which Vue's hook can capture. Error boundaries do not catch errors for event handlers, which Vue can capture.

| onErrorCaptured() | hook |
|---|---|
| onErrorCaptured() | Vue hook for a descendant error |
| setup() and watchers | Some of the Vue sources that can be captured |
| fallback UI | What a React Error Boundary can display |
| event handlers | Caught by Vue's hook; not caught by an Error Boundary |

## See also

- [vue-lifecycle-hooks](https://iinventedlight.com/library/notes/vue-lifecycle-hooks/)
- [nextjs-error-handling](https://iinventedlight.com/library/notes/nextjs-error-handling/)
- [react-components-basics](https://iinventedlight.com/library/notes/react-components-basics/)

## Claims

- id: C1
  claim: onErrorCaptured registers a hook when an error from a descendant component is captured.
  source: S1
  evidence: "error propagating from a descendant component has been captured"

- id: C2
  claim: Vue can capture errors from renders, event handlers, lifecycle hooks, setup(), and more.
  source: S1
  evidence: "Component renders"

- id: C3
  claim: A React Error Boundary can show fallback UI instead of the part that crashed.
  source: S2
  evidence: "display some fallback UI instead of the part that crashed"

## Sources

- [S1] onErrorCaptured(). Vue docs. https://vuejs.org/api/composition-api-lifecycle.html . License: CC-BY-4.0. Accessed 2026-11-19.

- [S2] Component. React docs. https://react.dev/reference/react/Component#catching-rendering-errors-with-an-error-boundary . License: CC-BY-4.0. Accessed 2026-11-19.

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: Vue docs, onErrorCaptured(); React docs, Component. CC-BY-4.0; CC-BY-4.0. Text was condensed and changed from the originals.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
