> For the complete documentation index, see [llms.txt](https://docs.acpt.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.acpt.io/developers/actions/acpt-error.md).

# acpt/error

Fires whenever ACPT catches an internal exception

**Type:** Action

Fires whenever ACPT catches an exception internally. ACPT's commands, queries, and integrations wrap their logic in `try/catch` blocks and report failures through this hook instead of letting them bubble up and break the page — use it to log errors to your own monitoring/logging system.

### Parameters

| Parameter    | Type         | Description          |
| ------------ | ------------ | -------------------- |
| `$exception` | `\Exception` | The caught exception |

### Usage

```php
add_action("acpt/error", function(Exception $exception){
    // do something, e.g. send it to your own error logger
    error_log($exception->getMessage());
}, 10, 1);
```
