@FunctionalInterface public interface BindingExceptionHandler extends Serializable
Exception
which may be thrown inside Binder.Binding
logic
to be able to identify the originator of the exception (the original
Exception
instance usually doesn't contain any information which
HasValue
object is the source of the exception).BindingException
Modifier and Type | Method and Description |
---|---|
Optional<BindingException> |
handleException(HasValue<?,?> field,
Exception exception)
Produces a
BindingException instance based on original
exception and field as a subject of the exception. |
Optional<BindingException> handleException(HasValue<?,?> field, Exception exception)
BindingException
instance based on original
exception
and field as a subject of the exception.
If the method returns an empty optional then the original exception will be thrown in the place where it has been caught.
The produced exception will be thrown instead of the exception
and may contain it as a cause and additional information based on the
field
.
field
- the subject of the exceptionexception
- an exception thrown within binding logicBindingException
, or an empty optional if no
additional information should be provided for the thrown
exceptionCopyright © 2022. All rights reserved.