Exception: Whoosh::Errors::ValidationError
- Inherits:
-
HttpError
- Object
- StandardError
- WhooshError
- HttpError
- Whoosh::Errors::ValidationError
- Defined in:
- lib/whoosh/errors.rb
Instance Attribute Summary collapse
-
#details ⇒ Object
readonly
Returns the value of attribute details.
Attributes inherited from HttpError
Instance Method Summary collapse
-
#initialize(details = []) ⇒ ValidationError
constructor
A new instance of ValidationError.
- #to_h ⇒ Object
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
#details ⇒ Object (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_h ⇒ Object
29 30 31 |
# File 'lib/whoosh/errors.rb', line 29 def to_h { error: error_type, details: details } end |