Sha256: f430f85b811721c0373e9f5057e065a599cf7f233d8a21dd94a0fab69ddef524

Contents?: true

Size: 586 Bytes

Versions: 14

Compression:

Stored size: 586 Bytes

Contents

# frozen_string_literal: true

class ErrorsController < ::ApplicationController
  layout "errors"

  def show
    render_error params[:id].to_i
  end

  def forbidden
    render_error 403
  end

  def not_found
    render_error 404
  end

  def unacceptable
    render_error 422
  end

  def unauthorized
    render_error 401
  end

  def internal_error
    exception = request.env["action_dispatch.exception"]
    if exception
      wrapper = ActionDispatch::ExceptionWrapper.new(nil, exception)
      render_error wrapper.status_code
    else
      render_error 500
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
pages_core-3.11.3 app/controllers/errors_controller.rb
pages_core-3.11.2 app/controllers/errors_controller.rb
pages_core-3.11.1 app/controllers/errors_controller.rb
pages_core-3.11.0 app/controllers/errors_controller.rb
pages_core-3.10.2 app/controllers/errors_controller.rb
pages_core-3.10.1 app/controllers/errors_controller.rb
pages_core-3.9.2 app/controllers/errors_controller.rb
pages_core-3.9.1 app/controllers/errors_controller.rb
pages_core-3.9.0 app/controllers/errors_controller.rb
pages_core-3.8.3 app/controllers/errors_controller.rb
pages_core-3.8.2 app/controllers/errors_controller.rb
pages_core-3.8.1 app/controllers/errors_controller.rb
pages_core-3.8.0 app/controllers/errors_controller.rb
pages_core-3.7.0 app/controllers/errors_controller.rb