Sha256: de820a1b4269eb9d4e17441b1f2a125420a31687e0d3a7b801a19b0c4b39e166

Contents?: true

Size: 611 Bytes

Versions: 4

Compression:

Stored size: 611 Bytes

Contents

# This patch enables the exception handler to catch routing errors
module ActionDispatch
  class ShowExceptions
    private
      def render_exception_with_template(env, exception)
        env = env.env if env.is_a?(ActionDispatch::Request) # Rails 5 passes in the whole request object
        if(RailsExceptionHandler.configuration.activate?)
          RailsExceptionHandler::Handler.new(env, exception).handle_exception
        else
          raise exception
        end
      end
      alias_method :render_exception, :render_exception_with_template
      alias_method :template, :render_exception
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rails_exception_handler-2.4.9 lib/patch/show_exceptions.rb
rails_exception_handler-2.4.8 lib/patch/show_exceptions.rb
rails_exception_handler-2.4.7 lib/patch/show_exceptions.rb
rails_exception_handler-2.4.6 lib/patch/show_exceptions.rb