---
title: Reporting errors
description: Learn how to report errors to Honeybadger in PHP applications.
url: https://docs.honeybadger.io/lib/php/guides/reporting-errors/
---

Honeybadger reports uncaught exceptions automatically. In all other cases, use `$honeybadger->notify()` and `$honeybadger->customNotification()` to send errors to Honeybadger.

## Reporting unhandled exceptions

By default, `honeybadger-php` registers global error and exception handlers which automatically report all unhandled exceptions to Honeybadger. These handlers can be disabled via the following [configuration options](https://docs.honeybadger.io/lib/php/reference/configuration/#default-configuration):

```php
[
    'handlers' => [
        // Enable global exception handler
        'exception' => true,


        // Enable global error handler
        'error' => true,
    ]
]
```

## Reporting handled exceptions

To catch an exception and notify Honeybadger without re-throwing:

```php
try {
  throw new Exception('Whoops!');
} catch (Exception $e) {
  $honeybadger->notify($e);
}
```

You can call `$honeybadger->notify()` anywhere in your code where you have an `Exception` to report.

### Including request data

You can optionally include a `\Symfony\Component\HttpFoundation\Request::class` request as the second argument to `$honeybadger->notify()`:

```php
$honeybadger->notify($e, $app->request());
```

When the request is included, HTTP information such as params, headers, and session data will be sent to Honeybadger.

## Sending custom notifications

To notify Honeybadger of other types of errors:

```php
$honeybadger->customNotification([
    'title'   => 'Special Error',
    'message' => 'Special Error: a special error has occurred',
]);
```

### Options

| Option Name | Description                                       |
| ----------- | ------------------------------------------------- |
| title       | The title of the error (normally the class name). |
| message     | The error message.                                |

---

## Try Honeybadger for FREE

Intelligent logging, error tracking, and Just Enough APM™ in one dev-friendly platform. Find and fix problems before users notice.

[Start free trial](https://app.honeybadger.io/users/sign_up)

[See plans and pricing](https://www.honeybadger.io/plans/)
