Package com.vaadin.flow.data.binder
Interface BindingExceptionHandler
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
DefaultBindingExceptionHandler
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Handles an
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).- Since:
- Author:
- Vaadin Ltd
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionhandleException
(HasValue<?, ?> field, Exception exception) Produces aBindingException
instance based on originalexception
and field as a subject of the exception.
-
Method Details
-
handleException
Produces aBindingException
instance based on originalexception
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 thefield
.- Parameters:
field
- the subject of the exceptionexception
- an exception thrown within binding logic- Returns:
- an optional
BindingException
, or an empty optional if no additional information should be provided for the thrown exception
-