class Athena::Validator::Exceptions::ValidationFailed
inherits Athena::Routing::Exceptions::UnprocessableEntity
#
Wraps an AVD::Violation::ConstraintViolationListInterface
as an ART::Exceptions::UnprocessableEntity
; exposing the violations within the response body.
Class methods#
.new(violations : AVD::Violation::ConstraintViolationInterface | AVD::Violation::ConstraintViolationListInterface, cause : Exception? = nil, headers : HTTP::Headers = HTTP::Headers.new)
#
(violations : AVD::Violation::ConstraintViolationInterface | AVD::Violation::ConstraintViolationListInterface, cause : Exception? = nil, headers : HTTP::Headers = HTTP::Headers.new)
Methods#
#to_json(builder : JSON::Builder) : Nil
#
(builder : JSON::Builder) : Nil
Serializes self
to JSON in the format of {"code":400,"message":"Exception message"}