<NuxtErrorBoundary>
En esta página
::tip
The <NuxtErrorBoundary> uses Vue's onErrorCaptured hook under the hood.
::
Events#
@error: Event emitted when the default slot of the component throws an error.
vue [app/app.vue]
<template>
<NuxtErrorBoundary @error="logSomeError">
<!-- ... -->
</NuxtErrorBoundary>
</template>
Slots#
#error: Specify a fallback content to display in case of error.
```vue [app/app.vue]
An error occurred: {{ error }}
<button @click="clearError">
Clear error
</button>
</template>
</NuxtErrorBoundary>
```
:read-more{to="/docs/4.x/getting-started/error-handling"}
Example#
Accessing error and clearError in Script#
You can access error and clearError properties within the component's script as below:
```vue [app/app.vue]
```