---
"title": "How-To: Use Heroku and Hoptoad for Collecting Exceptions"
"description": "Hoptoad is a great service by Thoughtbot for collecting exceptions. Like exception_notifier, but without clogging your inbox, and much prettier. Using..."
"date": "2008-09-18"
"authors":
  -
    "name": "Adam Wiggins"
"url": "https://www.heroku.com/blog/23_howto_heroku_hoptoad/"
"categories":
  - "News"
"tags":
  - "Developer Tools"
  - "Guide"
---

# How-To: Use Heroku and Hoptoad for Collecting Exceptions

[Hoptoad (now Airbrake)](https://www.airbrake.io/) is a great service by Thoughtbot for collecting exceptions. Like exception\_notifier, but without clogging your inbox, and much prettier. Using Hoptoad with Heroku is a cinch. First, [sign up for a free Hoptoad account](https://airbrake.io/account/new). Now install their notifier plugin. If you’re working locally and deploying to Heroku with Git, install with script/plugin:

```
script/plugin install git://github.com/thoughtbot/hoptoad_notifier.git
```

Or if you’re using the Heroku web editor, open the vendor folder and click Gems & Plugins, then enter the plugin URL in the “Install from URL” box at the bottom. Next, create a new file config/initializers/hoptoad.rb containing:

```
HoptoadNotifier.configure do |config|
  config.api_key = 'your_key_here'
end
```

Paste in the API key provided for your account in place of your\_key\_here. Last, add this line to your app/controllers/application.rb:

```
  include HoptoadNotifier::Catcher
```

To test, create a page that throws an exception:

```
class CrashController < ApplicationController
        def index
                raise "boom"
        end
end
```

If you’re in the web editor you can navigate straight to your app. If you’re working locally, commit and push to Heroku:

```
git add .
git commit -m 'use hoptoad for exception notifications'
git push
```

Now hit https://*yourapp*.heroku.com/crash to generate an exception. Flip over to your Hoptoad account, and you should see your CrashController exception in all its Hoptoad splendor!