Skip to content

Instantly share code, notes, and snippets.

@accuser
Created August 13, 2010 13:41
Show Gist options
  • Save accuser/522908 to your computer and use it in GitHub Desktop.
Save accuser/522908 to your computer and use it in GitHub Desktop.
# config/initializers/show_exceptions.rb
require 'action_dispatch/middleware/show_exceptions'
module ActionDispatch
class ShowExceptions
private
def render_exception_with_template(env, exception)
body = ErrorsController.action(rescue_responses[exception.class.name]).call(env)
log_error(exception)
body
rescue
render_exception_without_template(env, exception)
end
alias_method_chain :render_exception, :template
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment