Sha256: 0826d30ccc8705778e1a02d5691ab2c3d2792a3724231b211a1a89f6be90c3bf

Contents?: true

Size: 527 Bytes

Versions: 12

Compression:

Stored size: 527 Bytes

Contents

module FunWithJsonApi
  module Exceptions
    # Indicates a supplied attribute value is unknown to the current deserializer
    class UnknownAttribute < FunWithJsonApi::Exception
      def initialize(message, payload = ExceptionPayload.new)
        payload = Array.wrap(payload).each do |unknown|
          unknown.code ||= 'unknown_attribute'
          unknown.title ||= I18n.t(:unknown_attribute, scope: 'fun_with_json_api.exceptions')
          unknown.status ||= '400'
        end
        super
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
fun_with_json_api-0.0.14 lib/fun_with_json_api/exceptions/unknown_attribute.rb
fun_with_json_api-0.0.13 lib/fun_with_json_api/exceptions/unknown_attribute.rb
fun_with_json_api-0.0.11.3 lib/fun_with_json_api/exceptions/unknown_attribute.rb
fun_with_json_api-0.0.11.2 lib/fun_with_json_api/exceptions/unknown_attribute.rb
fun_with_json_api-0.0.11.1 lib/fun_with_json_api/exceptions/unknown_attribute.rb
fun_with_json_api-0.0.11 lib/fun_with_json_api/exceptions/unknown_attribute.rb
fun_with_json_api-0.0.10.4 lib/fun_with_json_api/exceptions/unknown_attribute.rb
fun_with_json_api-0.0.10.3 lib/fun_with_json_api/exceptions/unknown_attribute.rb
fun_with_json_api-0.0.10.2 lib/fun_with_json_api/exceptions/unknown_attribute.rb
fun_with_json_api-0.0.10.1 lib/fun_with_json_api/exceptions/unknown_attribute.rb
fun_with_json_api-0.0.10 lib/fun_with_json_api/exceptions/unknown_attribute.rb
fun_with_json_api-0.0.9 lib/fun_with_json_api/exceptions/unknown_attribute.rb