Sha256: 28ea681515733393e055863652d9c797344c1dc8228287ac29b61c7ee2b053e2

Contents?: true

Size: 759 Bytes

Versions: 2

Compression:

Stored size: 759 Bytes

Contents

ActionDispatch::DebugExceptions.class_eval do
  def render_exception_with_web_console(env, exception)
    render_exception_without_web_console(env, exception).tap do
      error = ActionDispatch::ExceptionWrapper.new(env, exception).exception

      # Get the original exception if ExceptionWrapper decides to follow it.
      env['web_console.exception'] = error

      # ActionView::Template::Error bypass ExceptionWrapper original
      # exception following. The backtrace in the view is generated from
      # reaching out to original_exception in the view.
      if error.is_a?(ActionView::Template::Error)
        env['web_console.exception'] = error.original_exception
      end
    end
  end

  alias_method_chain :render_exception, :web_console
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
web-console-2.1.3 lib/web_console/extensions.rb
web-console-2.1.2 lib/web_console/extensions.rb