Sha256: 5abb6d308ad7588cf601cfb429fb31f840accf23138f37294d4c747034b13f3f

Contents?: true

Size: 695 Bytes

Versions: 5

Compression:

Stored size: 695 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.environments.include?(Rails.env.to_sym))
          RailsExceptionHandler::Handler.new(env, exception).handle_exception
        else
          raise "RailsExceptionHandler: This patch should not have been loaded"
        end
      end
      alias_method :render_exception, :render_exception_with_template
      alias_method :template, :render_exception
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rails_exception_handler-2.4.5 lib/patch/show_exceptions.rb
rails_exception_handler-2.4.4 lib/patch/show_exceptions.rb
rails_exception_handler-2.4.1 lib/patch/show_exceptions.rb
rails_exception_handler-2.4.0 lib/patch/show_exceptions.rb
rails_exception_handler-2.3.5 lib/patch/show_exceptions.rb