2022-04-06 05:56:08 +00:00
|
|
|
# `useError`
|
|
|
|
|
2022-04-14 08:53:58 +00:00
|
|
|
Nuxt provides a composable to catch global errors.
|
|
|
|
|
|
|
|
This function will return the global Nuxt error that is being handled.
|
2022-04-06 05:56:08 +00:00
|
|
|
|
2022-04-14 08:53:58 +00:00
|
|
|
```ts
|
|
|
|
const error = useError()
|
|
|
|
```
|
|
|
|
|
2022-04-16 13:53:36 +00:00
|
|
|
`useError` sets an error in the state and creates a reactive and SSR-friendly global Nuxt error across components.
|
2022-04-14 08:53:58 +00:00
|
|
|
|
|
|
|
::ReadMore{link="/guide/features/error-handling"}
|
2022-04-06 05:56:08 +00:00
|
|
|
::
|