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

# PHP exception handling

Most applications raise some errors that aren't bugs in your code. They happen when the app encounters unexpected input, like a bot filling in a form.

To stop these errors from showing up as problems in AppSignal, you can handle them in code or let AppSignal ignore certain errors entirely.

## Ignore errors

AppSignal configuration lets you [ignore errors](/guides/filter-data/ignore-errors). Provide a list of error names in a denylist, and AppSignal will not track them when they are raised.

## `Appsignal::setError`

To record a handled exception use the `Appsignal::setError()` helper method. This is useful when catching and handling an error gracefully but still wanting to track it in AppSignal. For example, to monitor how often a fallback path is triggered.

```php PHP theme={null}
try {
    SomeClass::riskyOperation();
} catch (Throwable $e) {
    Appsignal::setError($e);
    throw $e;
}
```

<Note>
  The errors passed as an argument to `Appsignal::setError()` must implement the
  base `Throwable` interface.
</Note>
