Skip to content
A base library for Hoptoad error reporting
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Build Status

Deprecation warning: this library is outdated. Please use the new official Airbrake library instead.

A base library for Airbrake error reporting.

Toadhopper can be used to report plain old Ruby exceptions, or to build a framework-specific gem such as toadhopper-sinatra.

  raise "Kaboom!"
rescue  => e
  require 'toadhopper'

You can install it via rubygems:

gem install toadhopper

Posting Notices Over SSL

Toadhopper can transport your messages over SSL.

To enable SSL, just specify a :notify_host with a https:// protocol."YOURAPIKEY", :notify_host => '').post!(e)

Note: You must have a paid plan for Airbrake to accept your messages over SSL.

Example with :transport

Control freaks can customize a Net::HTTP to their liking with :transport.

require 'net/https'
require 'toadhopper'

def my_transport
  domain  = ''
  port    = 443
  transport = domain, port
  transport.set_debug_output $stderr # View verbose debugging
  transport.use_ssl       = true
  transport.ca_file       = Toadhopper::CA_FILE
  transport.verify_mode   = OpenSSL::SSL::VERIFY_PEER
  transport.open_timeout  = 7 # seconds
  transport.read_timeout  = 5 # seconds

def my_exception_handler(exception)
  api_key = 'YOURAPIKEY', :transport => my_transport).post! exception

Deploy tracking

You can use Toadhopper to notify Airbrake of deployments:


The method accepts options to set the environment, SCM revision, etc.

There is Capistrano support for deploy tracking. Simply require toadhopper/capistrano in your deploy config and set the variable airbrake_api_key:

require 'toadhopper/capistrano'

set :airbrake_api_key, 'YOURAPIKEY'

Supported Capistrano Keys

  • :airbrake_notify_host
  • :airbrake_error_url
  • :airbrake_deploy_url
  • :airbrake_transport


Toadhopper is tested against and compatible with the following ruby platforms:

  • 1.8.7

  • 1.9.2

  • 1.9.3

  • ree 1.8.7-2012.02

  • jruby 1.6.7 in both 1.8 mode and 1.9 mode

  • rubinius 2.0.testing branch in both 1.8 mode and 1.9 mode

    For jruby support, you need to gem install jruby-openssl if you do not already have that gem. More info on why this is.


Install Bundler 0.9.x, then:

% git clone git://
% cd toadhopper
% bundle install
% bundle exec rake test

If you set a AIRBRAKE_API_KEY environment variable it'll test actually posting to the Airbrake API. For example:

% bundle exec rake test AIRBRAKE_API_KEY=abc123

Set AIRBRAKE_FULL_TEST to test integration operations that require a paid Airbrake plan such as posting over SSL, deploy tracking, and github integration. For example:

% bundle exec rake test AIRBRAKE_API_KEY=abc123 AIRBRAKE_FULL_TEST=1

Beware: Setting AIRBRAKE_FULL_TEST will record a bogus deployment in your Airbrake project and auto-resolve any pre-existing development errors.

To generate the docs:

% bundle exec yardoc

To build the gem:

% bundle exec rake build


You can’t perform that action at this time.