class CrSerializer::Exceptions::ValidationException
- CrSerializer::Exceptions::ValidationException
- Exception
- Reference
- Object
Overview
Exception thrown when an object is not valid and raise_on_invalid
is true
Defined in:
CrSerializer/exceptions/validation_exception.crConstructors
Instance Method Summary
-
#to_json : String
Returns a validation failed 400 JSON error for easy error handling with REST APIs
Constructor Detail
Instance Method Detail
def to_json : String
#
Returns a validation failed 400 JSON error for easy error handling with REST APIs
{
"code": 400,
"message": "Validation tests failed",
"errors": [
"'password' should not be blank",
"'age' should be greater than 1",
],
}