# useError()

```typescript
export interface SyntheticError extends Error {
  status: number;
  response?: undefined;
  synthetic: true;
}

function useError(
  endpoint: Endpoint,
  ...args: Parameters<typeof endpoint> | [null]
): NetworkError | Unknown | SyntheticError | undefined;
```

[NetworkError](https://dataclient.io/docs/api/types.md#networkerror)

Provides error information about a request.

Used in

- [useFetch()](https://dataclient.io/docs/api/useFetch.md)
- [useSuspense()](https://dataclient.io/docs/api/useSuspense.md)
- [useCache()](https://dataclient.io/docs/api/useCache.md)
