ValidationException class

Inheritance

Constructors

ValidationException({dynamic message = const <String, dynamic>{}, String errorCode = 'validation_failed', int code = HttpStatus.unprocessableEntity, List<ValidationIssue> issues = const <ValidationIssue>[]})

Properties

code ↔ int
getter/setter pairinherited
errorCode ↔ String
getter/setter pairinherited
hashCode → int
The hash code for this object.
no setterinherited
issues → List<ValidationIssue>
Every issue of the failed check, with its path, rule code, message and params. message has only the first message of each path. An ExceptionHandler can use it to send another error shape, like [{field, message, rule}]. Empty when the error was made by hand.
final
message ↔ dynamic
getter/setter pairinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toResponse() → dynamic
the JSON body of the error answer: {"code": "not_found", "message": "Not Found"}. a Map message is sent as it is, so validation errors and custom JSON keep their own shape.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited