Skip to content

Instantly share code, notes, and snippets.

@brianr
Last active March 30, 2016 21:36
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brianr/4199634 to your computer and use it in GitHub Desktop.
Save brianr/4199634 to your computer and use it in GitHub Desktop.
basic Rollbar usage with sinatra
require 'sinatra'
require 'rollbar'
configure do
Rollbar.configure do |config|
config.access_token = 'aaaabbbbccccddddeeeeffff00001111'
config.environment = 'sinatra-test'
end
end
get '/' do
begin
foo = bar
rescue => e
Rollbar.report_exception(e)
end
Rollbar.report_message("test message")
"Hello world!"
end
@sorich87
Copy link

I had to add the following to automatically report every exception in production:

error do
  Ratchetio.report_exception(env['sinatra.error'])
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment