Skip to content

Instantly share code, notes, and snippets.

@oren
Created September 22, 2010 20:37
Show Gist options
  • Save oren/592518 to your computer and use it in GitHub Desktop.
Save oren/592518 to your computer and use it in GitHub Desktop.
main.rb
---------------------------------------------
get '/' do
raise "explode!"
end
mailexceptions.rb
---------------------------------------------
def call(env)
status, headers, body =
begin
require 'ap' #awesome_print gem
ap 'in the begin block'
@app.call(env)
rescue => boom
ap 'in the rescue block' # I don't see this in the server log
send_notification boom, env
raise
end
send_notification env['mail.exception'], env if env['mail.exception']
[status, headers, body]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment