> ## Documentation Index
> Fetch the complete documentation index at: https://docs.daily.co/llms.txt
> Use this file to discover all available pages before exploring further.

# useDailyError

> useDailyError returns a stateful representation of the most recent error and nonfatal-error event objects.

`useDailyError() : Object`

> [!NOTE]
>
> Keep in mind that an `error` event will cause a participant to be ejected immediately from a meeting. If you need to render UI based on the `meetingError` state, make sure that you don't destroy the `callObject` instance until you no longer need the error state. This includes updating any props for [`DailyProvider`](https://docs.daily.co/reference/daily-react/daily-provider) as we'll destroy the current `callObject` instance internally in order to setup a new one with the updated props.

## Return value

An object with the following properties:

**meetingError** `Object`

The most recent event object from the [`error`](https://docs.daily.co/reference/daily-js/events/error-events#error) event.

**nonFatalError** `Object`

The most recent event object from the [`nonfatal-error`](https://docs.daily.co/reference/daily-js/events/error-events#nonfatal-error) event.

## Example

```jsx theme={null}
import { useDailyError } from '@daily-co/daily-react';

export const MyMeetingState = () => {
  const { meetingError, nonFatalError } = useDailyError();

  return (
    <div>
      <p>Most recent meeting error: {meetingError?.errorMsg}</p>
      <p>Most recent nonfatal error: {nonFatalError?.errorMsg}</p>
    </div>
  );
};
```

## See also

> [card] Events
>
> * [error](https://docs.daily.co/reference/daily-js/events/error-events.md#error)
> * [nonfatal-error](https://docs.daily.co/reference/daily-js/events/error-events.md#nonfatal-error)

> [card] Components
>
> * [DailyProvider](https://docs.daily.co/reference/daily-react/daily-provider.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.