2022-10-06 09:15:30 +00:00
---
title: "< NuxtErrorBoundary > "
description: The < NuxtErrorBoundary > component handles client-side errors happening in its default slot.
---
2022-04-06 05:56:08 +00:00
# `<NuxtErrorBoundary>`
2022-10-06 09:15:30 +00:00
The `<NuxtErrorBoundary>` component handles client-side errors happening in its default slot, using Vue's [`onErrorCaptured` hook. ](https://vuejs.org/api/composition-api-lifecycle.html#onerrorcaptured )
2022-04-07 13:26:36 +00:00
## Events
2022-04-07 14:02:54 +00:00
- **`@error`**: Event emitted when the default slot of the component throws an error.
2022-04-07 13:26:36 +00:00
```vue
< template >
< NuxtErrorBoundary @error =" logSomeError " >
<!-- ... -->
< / NuxtErrorBoundary >
< / template >
```
2022-04-06 05:56:08 +00:00
2022-04-07 13:26:36 +00:00
## Slots
- **#error**: Specify a fallback content to display in case of error.
```vue
< template >
< NuxtErrorBoundary >
<!-- ... -->
< template #error ="{ error }" >
2022-06-08 19:49:11 +00:00
< p > An error occurred: {{ error }}< / p >
2022-04-07 13:26:36 +00:00
< / template >
< / NuxtErrorBoundary >
< / template >
```
2022-11-16 10:04:28 +00:00
::ReadMore{link="/docs/getting-started/error-handling"}
2022-04-06 05:56:08 +00:00
::