Exception: JSONAPI::Exceptions::InvalidFiltersSyntax

Inherits:
Error
  • Object
show all
Defined in:
lib/jsonapi/exceptions.rb

Instance Attribute Summary collapse

Attributes inherited from Error

#error_object_overrides

Instance Method Summary collapse

Methods inherited from Error

#create_error_object

Constructor Details

#initialize(filters, error_object_overrides = {}) ⇒ InvalidFiltersSyntax

Returns a new instance of InvalidFiltersSyntax.



185
186
187
188
# File 'lib/jsonapi/exceptions.rb', line 185

def initialize(filters, error_object_overrides = {})
  @filters = filters
  super(error_object_overrides)
end

Instance Attribute Details

#filtersObject

Returns the value of attribute filters.



183
184
185
# File 'lib/jsonapi/exceptions.rb', line 183

def filters
  @filters
end

Instance Method Details

#errorsObject



190
191
192
193
194
195
196
197
198
# File 'lib/jsonapi/exceptions.rb', line 190

def errors
  [create_error_object(code: JSONAPI::INVALID_FILTERS_SYNTAX,
                       status: :bad_request,
                       title: I18n.translate('jsonapi-resources.exceptions.invalid_filter_syntax.title',
                                             default: 'Invalid filters syntax'),
                       detail: I18n.translate('jsonapi-resources.exceptions.invalid_filter_syntax.detail',
                                              default: "#{filters} is not a valid syntax for filtering.",
                                              filters: filters))]
end