# Suspense Has No Built-in Error Handling ## Rule `` does not provide error handling via the component itself. You must implement error handling using `errorCaptured` option or `onErrorCaptured()` hook in a parent component to catch async errors. ## Why This Matters Without explicit error handling, async errors in suspended components will propagate uncaught, potentially crashing the application or leaving users stuck on loading states. Unlike React's Error Boundaries, Vue's Suspense requires manual error boundary implementation. ## Bad Code ```vue ``` ## Good Code ```vue ``` ## Reusable Error Boundary Pattern ```vue ``` ```vue ``` ## Key Points 1. Always wrap `` with error handling logic in production 2. Use `onErrorCaptured` for Composition API or `errorCaptured` option for Options API 3. Return `false` from the error handler to stop propagation 4. Consider creating a reusable `ErrorBoundary` component to reduce boilerplate 5. Provide a way for users to retry failed operations ## References - [Vue.js Suspense Documentation](https://vuejs.org/guide/built-ins/suspense#error-handling) - [Vue.js onErrorCaptured](https://vuejs.org/api/composition-api-lifecycle#onerrorcaptured)