Exception: Whoosh::Errors::ValidationError

Inherits:
HttpError show all
Defined in:
lib/whoosh/errors.rb

Instance Attribute Summary collapse

Attributes inherited from HttpError

#error_type, #status

Instance Method Summary collapse

Constructor Details

#initialize(details = []) ⇒ ValidationError

Returns a new instance of ValidationError.



24
25
26
27
# File 'lib/whoosh/errors.rb', line 24

def initialize(details = [])
  @details = details
  super("Validation failed", status: 422, error_type: "validation_failed")
end

Instance Attribute Details

#detailsObject (readonly)

Returns the value of attribute details.



22
23
24
# File 'lib/whoosh/errors.rb', line 22

def details
  @details
end

Instance Method Details

#to_hObject



29
30
31
# File 'lib/whoosh/errors.rb', line 29

def to_h
  { error: error_type, details: details }
end