Install Exceptional in your Sinatra app

1. Install the exceptional gem:

	$ gem install exceptional

2. Install the json gem of your choice (choices are: json, json_pure, yajl-ruby, json-jruby):

 $ gem install json

3. Add Exceptional to your sinatra app's production environment

	require 'exceptional'
	use Rack::Exceptional, API_KEY if ENV['RACK_ENV'] == 'production'

You will find the API_KEY in the apps settings screen within Exceptional.

4. Ensure :raise_errors is set to true

	set :raise_errors, true

5. Ensure Exceptional for Rack is being loaded

Check log/exceptional.log log file




Example

require 'rubygems'
require 'sinatra'

set :raise_errors, true

require 'exceptional'
use Rack::Exceptional, API_KEY

get '/' do
  "Hello World!"
end

get '/error' do
  big.problem!
end