> ## 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`](/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.
</Note>

## Return value

An object with the following properties:

<ResponseField name="meetingError" type="Object">
  The most recent event object from the [`error`](/reference/daily-js/events/error-events#error) event.
</ResponseField>

<ResponseField name="nonFatalError" type="Object">
  The most recent event object from the [`nonfatal-error`](/reference/daily-js/events/error-events#nonfatal-error) event.
</ResponseField>

## 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

<CardGroup>
  <Card title="Events" icon="bolt" iconType="solid">
    * [error](/reference/daily-js/events/error-events#error)
    * [nonfatal-error](/reference/daily-js/events/error-events#nonfatal-error)
  </Card>

  <Card title="Components" icon="layout" iconType="solid">
    * [DailyProvider](/reference/daily-react/daily-provider)
  </Card>
</CardGroup>
