---
title: Reporting errors
description: Manually report errors from Go applications to Honeybadger using the Notify function.
url: https://docs.honeybadger.io/lib/go/errors/reporting-errors/
---

Honeybadger reports unhandled panics automatically when you use `honeybadger.Handler` or `honeybadger.Monitor()`. In all other cases, use `honeybadger.Notify` to send errors to Honeybadger.

## Using honeybadger.Notify

If you’ve handled a panic in your code, but would still like to report the error to Honeybadger, use `honeybadger.Notify`:

```go
if err != nil {
    honeybadger.Notify(err)
}
```

## Adding context to notifications

You can add local context using an optional second argument with [`Context`](https://pkg.go.dev/github.com/honeybadger-io/honeybadger-go#Context):

```go
honeybadger.Notify(err, honeybadger.Context{"user_id": 2})
```

See [Adding context to errors](https://docs.honeybadger.io/lib/go/errors/context/) for more details.

## Customizing error grouping

Honeybadger uses the error’s class name to group similar errors together. If your error classes are often generic (such as `errors.errorString`), you can improve grouping by overriding the default with [`ErrorClass`](https://pkg.go.dev/github.com/honeybadger-io/honeybadger-go#ErrorClass):

```go
honeybadger.Notify(err, honeybadger.ErrorClass{"CustomClassName"})
```

To override grouping entirely, you can send a custom [`Fingerprint`](https://pkg.go.dev/github.com/honeybadger-io/honeybadger-go#Fingerprint). All errors with the same fingerprint will be grouped together:

```go
honeybadger.Notify(err, honeybadger.Fingerprint{"A unique string"})
```

See [Customizing error grouping](https://docs.honeybadger.io/lib/go/errors/customizing-error-grouping/) for more details.

## Adding tags

To tag errors in Honeybadger using [`Tags`](https://pkg.go.dev/github.com/honeybadger-io/honeybadger-go#Tags):

```go
honeybadger.Notify(err, honeybadger.Tags{"timeout", "http"})
```

See [Tagging errors](https://docs.honeybadger.io/lib/go/errors/tagging-errors/) for more details.

## Combining options

You can combine multiple options in a single `Notify` call:

```go
honeybadger.Notify(err,
    honeybadger.Context{"user_id": 2},
    honeybadger.Tags{"timeout", "http"},
    honeybadger.ErrorClass{"TimeoutError"},
)
```

## Including HTTP request data

When reporting errors from HTTP handlers, you can pass the request directly to include URL, parameters, and headers automatically:

```go
honeybadger.Notify(err, r) // r is *http.Request
```

For more control, you can pass specific request data using [`Params`](https://pkg.go.dev/github.com/honeybadger-io/honeybadger-go#Params) and [`CGIData`](https://pkg.go.dev/github.com/honeybadger-io/honeybadger-go#CGIData):

```go
// Include URL parameters
honeybadger.Notify(err, honeybadger.Params(r.URL.Query()))


// Include form data
r.ParseForm()
honeybadger.Notify(err, honeybadger.Params(r.Form))


// Include HTTP headers as CGI data
honeybadger.Notify(err, honeybadger.CGIData{
    "REQUEST_METHOD": r.Method,
    "HTTP_USER_AGENT": r.UserAgent(),
    "REMOTE_ADDR": r.RemoteAddr,
})


// Include the request URL
honeybadger.Notify(err, r.URL)
```

**Note:** When using `honeybadger.Handler`, request data is captured automatically. See the [HTTP integration guide](https://docs.honeybadger.io/lib/go/integrations/http/) for details.

---

## 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/)
