Sha256: bb0d5be4b56e02dbe2accd0ef8491c3fa57354b973c96e705f56a2a3f795db4a

Contents?: true

Size: 590 Bytes

Versions: 8

Compression:

Stored size: 590 Bytes

Contents

module FunWithJsonApi
  module Exceptions
    # Indicates a supplied relationship value is known but unable to be changed by this endpoint
    class UnauthorizedRelationship < FunWithJsonApi::Exception
      def initialize(message, payload = ExceptionPayload.new)
        payload = Array.wrap(payload).each do |unknown|
          unknown.code ||= 'unauthorized_relationship'
          unknown.title ||= I18n.t(
            :unauthorized_relationship, scope: 'fun_with_json_api.exceptions'
          )
          unknown.status ||= '403'
        end
        super
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
fun_with_json_api-0.0.14 lib/fun_with_json_api/exceptions/unauthorized_relationship.rb
fun_with_json_api-0.0.13 lib/fun_with_json_api/exceptions/unauthorized_relationship.rb
fun_with_json_api-0.0.11.3 lib/fun_with_json_api/exceptions/unauthorized_relationship.rb
fun_with_json_api-0.0.11.2 lib/fun_with_json_api/exceptions/unauthorized_relationship.rb
fun_with_json_api-0.0.11.1 lib/fun_with_json_api/exceptions/unauthorized_relationship.rb
fun_with_json_api-0.0.11 lib/fun_with_json_api/exceptions/unauthorized_relationship.rb
fun_with_json_api-0.0.10.4 lib/fun_with_json_api/exceptions/unauthorized_relationship.rb
fun_with_json_api-0.0.10.3 lib/fun_with_json_api/exceptions/unauthorized_relationship.rb