Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions docs/reference/public-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,28 @@ try {

See [TransactionInterface](#api-transaction-interface) on how to customize a transaction.

### `ElasticApm::createErrorFromThrowable` [api-elasticapm-class-create-error-from-throwable]

Captures a throwable exception. This API:
* Captures an error as an exception
* Displays it in the ElasticAPM `Errors` screen
* Allows for easy tracking of caught exceptions.

For example:
```php
use Elastic\Apm\ElasticApm;

private function captureExceptionFromErrorMessage($message)
{
try {
throw new Exception($message);
} catch (Throwable $ex) {
ElasticApm::createErrorFromThrowable($ex);
}
}
```

The code above would allow for an error message to be tracked via an artificially created exception.

### `ElasticApm::captureCurrentTransaction` [api-elasticapm-class-capture-current-transaction]

Expand Down