Sha256: 50e18fd205c78156e6cdd1f6e47eeffc1bdf8509147ac9820ad0a544acb3c26c

Contents?: true

Size: 723 Bytes

Versions: 9

Compression:

Stored size: 723 Bytes

Contents

module WebConsole
  module Interceptor
    def self.call(request, exception)
      backtrace_cleaner = request.get_header("action_dispatch.backtrace_cleaner")
      error = ActionDispatch::ExceptionWrapper.new(backtrace_cleaner, exception).exception

      # Get the original exception if ExceptionWrapper decides to follow it.
      Thread.current[:__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)
        Thread.current[:__web_console_exception] = error.cause
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
web-console-4.2.0 lib/web_console/interceptor.rb
web-console-4.1.0 lib/web_console/interceptor.rb
web-console-4.0.4 lib/web_console/interceptor.rb
web-console-4.0.3 lib/web_console/interceptor.rb
web-console-4.0.2 lib/web_console/interceptor.rb
chatops-rpc-0.0.2 fixtures/chatops-controller-example/vendor/bundle/ruby/2.5.0/gems/web-console-4.0.1/lib/web_console/interceptor.rb
chatops-rpc-0.0.1 fixtures/chatops-controller-example/vendor/bundle/ruby/2.5.0/gems/web-console-4.0.1/lib/web_console/interceptor.rb
web-console-4.0.1 lib/web_console/interceptor.rb
web-console-4.0.0 lib/web_console/interceptor.rb