---
title: Reporting errors
description: Report errors from Ruby applications to Honeybadger with automatic notifications and custom error handling.
url: https://docs.honeybadger.io/lib/ruby/errors/reporting-errors/
---

Use `Honeybadger.notify(exception)` to send any exception to Honeybadger. For example, to notify Honeybadger of a rescued exception without re-raising:

controller.rb

```ruby
begin
  fail 'oops'
rescue => exception
  Honeybadger.notify(exception)
end
```

## Reporting errors without an exception

You can report any type of error to Honeybadger, not just exceptions. The simplest form is calling `Honeybadger.notify` with an error message:

```ruby
Honeybadger.notify("Something is wrong here")
```

The error’s class name will default to “Notice”, and a backtrace will be generated for you from the location in your code where `Honeybadger.notify` was called.

## Passing additional options to `Honeybadger.notify`

In some cases you will want to override the defaults or add additional information to your error reports. To do so, you can pass a second options `Hash` to `Honeybadger.notify`.

For example, building on the example in [Reporting errors without an exception](https://docs.honeybadger.io/lib/ruby/errors/reporting-errors/#reporting-errors-without-an-exception), you could override the default class name:

```ruby
Honeybadger.notify("Something is wrong here", error_class: "MyError")
```

These are all the available options you can pass to `Honeybadger.notify`:

| Option name      | Description                                                    | Default value |
| ---------------- | -------------------------------------------------------------- | ------------- |
| `:error_message` | The `String` error message.                                    | `nil`         |
| `:error_class`   | The `String` class name of the error.                          | `"Notice"`    |
| `:backtrace`     | The `Array` backtrace of the error.                            | `caller`      |
| `:fingerprint`   | The `String` grouping fingerprint of the exception.            | `nil`         |
| `:force`         | Always report the exception when `true`, even when ignored.    | `false`       |
| `:sync`          | Send data synchronously (skips the worker) when `true`.        | `false`       |
| `:tags`          | The `String` comma-separated list of tags.                     | `nil`         |
| `:context`       | The `Hash` context to associate with the exception.            | `nil`         |
| `:controller`    | The `String` controller name (such as a Rails controller).     | `nil`         |
| `:component`     | The `String` component name (such as a Rails controller name). | `nil`         |
| `:action`        | The `String` action name (such as a Rails controller action).  | `nil`         |
| `:parameters`    | The `Hash` HTTP request paramaters.                            | `nil`         |
| `:session`       | The `Hash` HTTP request session.                               | `nil`         |
| `:url`           | The `String` HTTP request URL.                                 | `nil`         |

## Getting the current backtrace

There are two ways to get the current backtrace in Ruby:

1. `Thread.current.backtrace` returns the entire backtrace up to and including the current method.
2. `caller` returns the backtrace up to but NOT including the current method.

Either method can be passed to `Honeybadger.notify` using the `backtrace` option. Honeybadger sends the exception backtrace by default, or `caller` if there is no exception object available.

---

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