BindException class

The exception DataBinder.close throws when binding or validation found errors; it carries them in bindingResult.

Throw or catch it where a whole bind-and-check step must succeed. The web starter reports invalid @Valid() arguments with its own MethodArgumentNotValidException, which also holds a binding result.

// Bind, check, and stop on the first invalid input.
try {
  final model = binder.close();
} on BindException catch (e) {
  log.warning(e.bindingResult.errorCount);
}

Spring (Java):

try {
  Map<?, ?> model = binder.close();
} catch (BindException e) {
  log.warn("{} errors", e.getBindingResult().getErrorCount());
}
Implemented types

Constructors

BindException(BindingResult bindingResult)
An exception for the errors in bindingResult.

Properties

bindingResult → BindingResult
The errors, with the target they are about.
final
hashCode → int
The hash code for this object.
no setterinherited
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
toString() → String
A string representation of this object.
override

Operators

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