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

# Detecting errors

Layer's React components expose error callbacks to notify you of errors that occur within the embedded components. Use the `onError` property on `<LayerProvider>` to get notified about all exceptions within the components:

```ts theme={null}
<LayerProvider
  businessId="..."
  environment="..."
  appId="..."
  onError={err => console.log('My error callback', err)}
>
  {...}
</LayerProvider>
```

This can be done both on the top level `<LayerProvider>` component and within specific components.

```ts theme={null}
<BankTransactions onError={e => console.log('My callback:', e)} />
```
