We want to see errors in production only for our admin controllers.
In Rails 2 this was simple, but now we had to get hacky:
class AdminController < ApplicationController rescue_from Exception, :with => :render_simple_error if Rails.env.production? def render_simple_error(e) render :text => "#{e.message} -- #{e.class}<br/>#{e.backtrace.join("<br/>")}" end end
Its not very pretty (session/params are missing), but solves our pain for now.
Nice little solution.
Note: you’ve got a copy/paste error, as you access the exception as “e” inside the render_simple_error method
Tanks, fixed 🙂