diff --git a/config/puma.rb b/config/puma.rb index 9886e1e5..1d43c487 100644 --- a/config/puma.rb +++ b/config/puma.rb @@ -43,5 +43,16 @@ on_worker_boot do ActiveRecord::Base.establish_connection if defined?(ActiveRecord) end +lowlevel_error_handler do |ex, env| + Raven.capture_exception( + ex, + :message => ex.message, + :extra => { :puma => env }, + :transaction => "Puma" + ) + # note the below is just a Rack response + [500, {}, ["An error has occurred, and engineers have been informed. Please reload the page. If you continue to have problems, contact conference@snap.berkeley.edu\n"]] +end + # Allow puma to be restarted by `rails restart` command. plugin :tmp_restart