Sha256: 65d6803090cd28e2aa85bdd895e6eae62d65ec762f4011c01105ac19f50d1549

Contents?: true

Size: 518 Bytes

Versions: 5

Compression:

Stored size: 518 Bytes

Contents

module FunWithJsonApi
  module Exceptions
    # Indicates a Resource was unable to be used with performing an update
    class InvalidResource < FunWithJsonApi::Exception
      def initialize(message, payload = ExceptionPayload.new)
        payload = Array.wrap(payload).each do |invalid|
          invalid.code ||= 'invalid_resource'
          invalid.title ||= I18n.t('invalid_resource', scope: 'fun_with_json_api.exceptions')
          invalid.status ||= '422'
        end
        super
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
fun_with_json_api-0.0.10 lib/fun_with_json_api/exceptions/invalid_resource.rb
fun_with_json_api-0.0.9 lib/fun_with_json_api/exceptions/invalid_resource.rb
fun_with_json_api-0.0.8.2 lib/fun_with_json_api/exceptions/invalid_resource.rb
fun_with_json_api-0.0.8.1 lib/fun_with_json_api/exceptions/invalid_resource.rb
fun_with_json_api-0.0.8 lib/fun_with_json_api/exceptions/invalid_resource.rb