2023-02-04 14:17:05 +00:00
---
title: "useError"
description: useError composable returns the global Nuxt error that is being handled.
---
2022-04-06 05:56:08 +00:00
# `useError`
2023-02-04 14:17:05 +00:00
`useError` composable returns the global Nuxt error that is being handled and it is available on both client and server.
2022-04-06 05:56:08 +00:00
2022-04-14 08:53:58 +00:00
```ts
const error = useError()
```
2023-02-04 14:17:05 +00:00
`useError` sets an error in the state and creates a reactive as well as SSR-friendly global Nuxt error across components. Nuxt errors have the following properties:
## Properties
- **statusCode**
Type: `Number`
HTTP response status code
- **statusMessage**
Type: `String`
HTTP response status message
- **message**
Type: `String`
Error message
2022-04-14 08:53:58 +00:00
2022-11-16 10:04:28 +00:00
::ReadMore{link="/docs/getting-started/error-handling"}
2022-04-06 05:56:08 +00:00
::