Reporting handled errors

In order to quickly understand and fix some errors, it is often helpful to send additional diagnostic data which is specific to that error.

The bugsnag.Notify() function accepts several predefined options for customizing the error report.


The context shows up prominently in the list view so that you can get an idea of where a problem occurred. You can set it by passing a bugsnag.Context object as rawData.

bugsnag.Notify(err, bugsnag.Context{String: "backgroundJob"})


Errors in your Bugsnag dashboard are grouped by their “error class” and by line number. You can override the error class by passing a bugsnag.ErrorClass object as rawData.

bugsnag.Notify(err, bugsnag.ErrorClass{Name: "I/O Timeout"})


Custom metaData appears as tabs on You can set it by passing a bugsnag.MetaData object as rawData.

        "Account": {
            "Name": Account.Name,
            "Paying": Account.Plan.Premium,

bugsnag.SeverityError, bugsnag.SeverityInfo, bugsnag.SeverityWarning

Bugsnag supports three severities, SeverityError, SeverityWarning, and SeverityInfo. You can set the severity of an error by passing one of these objects as rawData.

bugsnag.Notify(err, bugsnag.SeverityInfo)


User data is searchable, and the Id powers the count of users affected. You can set which user an error affects by passing a bugsnag.User object as rawData.

bugsnag.Notify(err, bugsnag.User{
    Id: "1234", Name: "Conrad", Email: ""})

http.Request, revel.Controller

Bugsnag can extract interesting data from *http.Request objects, and *revel.Controller objects. These are automatically passed in when handling panics, and you can pass them yourself.

func (w http.ResponseWriter, r *http.Request) {
    bugsnag.Notify(err, r)