Sha256: 2dc7e5125c83a241af21edf96aaddce7bbb913671058884b237e0262a5785274

Contents?: true

Size: 372 Bytes

Versions: 17

Compression:

Stored size: 372 Bytes

Contents

# frozen_string_literal: true

# THe error code API
class ErrorController < ApplicationController
  # GET error/:code
  def show
    render status: :bad_request, json: error_response
  end

  private

  def error_response
    code = params[:code].to_i
    {
      error: {
        code: code,
        message: "You requested error code: #{code}",
      },
    }
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
my_api_client-1.1.0 my_api/app/controllers/error_controller.rb
my_api_client-1.0.0 my_api/app/controllers/error_controller.rb
my_api_client-0.27.0 my_api/app/controllers/error_controller.rb
my_api_client-0.26.0 my_api/app/controllers/error_controller.rb
my_api_client-0.25.0 my_api/app/controllers/error_controller.rb
my_api_client-0.24.0 my_api/app/controllers/error_controller.rb
my_api_client-0.23.0 my_api/app/controllers/error_controller.rb
my_api_client-0.22.0 my_api/app/controllers/error_controller.rb
my_api_client-0.21.0 my_api/app/controllers/error_controller.rb
my_api_client-0.20.0 my_api/app/controllers/error_controller.rb
my_api_client-0.19.0 my_api/app/controllers/error_controller.rb
my_api_client-0.18.0 my_api/app/controllers/error_controller.rb
my_api_client-0.17.0 my_api/app/controllers/error_controller.rb
my_api_client-0.16.1 my_api/app/controllers/error_controller.rb
my_api_client-0.16.0 my_api/app/controllers/error_controller.rb
my_api_client-0.15.0 my_api/app/controllers/error_controller.rb
my_api_client-0.14.0 my_api/app/controllers/error_controller.rb