Sha256: df5167fd5eb379ab2226e303a97d290122bfe97355a413f880f338139b0bc90d

Contents?: true

Size: 801 Bytes

Versions: 9

Compression:

Stored size: 801 Bytes

Contents

module Errdo
  class ExceptionsController < ActionDispatch::PublicExceptions

    # attr_accessor :public_path

    # def initialize(public_path)
    #   super
    # end

    def call(env)
      status       = env["PATH_INFO"][1..-1]
      request      = ActionDispatch::Request.new(env)
      content_type = request.formats.first
      body         = {  status: status,
                        error: Rack::Utils::HTTP_STATUS_CODES.fetch(status.to_i, Rack::Utils::HTTP_STATUS_CODES[500]) }

      Errdo::Exception.new(env)
      render(status, content_type, body)
    end

    # private

    # def render(status, content_type, body)
    #   super
    # end

    # def render_format(status, content_type, body)
    #   super
    # end

    # def render_html(status)
    #   super
    # end

  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
errdo-0.11.5 app/controllers/errdo/exceptions_controller.rb
errdo-0.11.4 app/controllers/errdo/exceptions_controller.rb
errdo-0.11.3 app/controllers/errdo/exceptions_controller.rb
errdo-0.11.2 app/controllers/errdo/exceptions_controller.rb
errdo-0.11.1 app/controllers/errdo/exceptions_controller.rb
errdo-0.11.0 app/controllers/errdo/exceptions_controller.rb
errdo-0.10.0 app/controllers/errdo/exceptions_controller.rb
errdo-0.9.1 app/controllers/errdo/exceptions_controller.rb
errdo-0.9.0 app/controllers/errdo/exceptions_controller.rb