Exception: JPie::Errors::UnsupportedSortFieldError
- Inherits:
-
BadRequestError
- Object
- StandardError
- Error
- BadRequestError
- JPie::Errors::UnsupportedSortFieldError
- Defined in:
- lib/jpie/errors.rb
Instance Attribute Summary
Attributes inherited from Error
#code, #detail, #source, #status, #title
Instance Method Summary collapse
-
#initialize(sort_field:, supported_fields: []) ⇒ UnsupportedSortFieldError
constructor
A new instance of UnsupportedSortFieldError.
Methods inherited from Error
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 |