Exception: JPie::Errors::UnsupportedSortFieldError

Inherits:
BadRequestError show all
Defined in:
lib/jpie/errors.rb

Instance Attribute Summary

Attributes inherited from Error

#code, #detail, #source, #status, #title

Instance Method Summary collapse

Methods inherited from Error

#to_hash

Constructor Details

#initialize(sort_field:, supported_fields: []) ⇒ UnsupportedSortFieldError

Returns a new instance of UnsupportedSortFieldError.



95
96
97
98
99
100
101
102
# File 'lib/jpie/errors.rb', line 95

def initialize(sort_field:, supported_fields: [])
  detail = if supported_fields.any?
             "Unsupported sort field '#{sort_field}'. Supported fields: #{supported_fields.join(', ')}"
           else
             "Unsupported sort field '#{sort_field}'. No sorting is supported for this resource"
           end
  super(detail: detail)
end