com.vaadin.flow.data.binder.
Class DefaultBindingExceptionHandler
- java.lang.Object
-
- com.vaadin.flow.data.binder.DefaultBindingExceptionHandler
-
All Implemented Interfaces:
public class DefaultBindingExceptionHandler extends Object implements BindingExceptionHandler
Default implementation of
BindingExceptionHandler
.The handler tries to identify the
HasElement
field using"label"
and"id"
property values and if they are not available it tries dump all the attributes and properties in dev mode. The exception is not produced if the element has no any attribute or property.Since:
Author:
Vaadin Ltd
See Also:
-
-
Constructor Summary
Constructors Constructor Description DefaultBindingExceptionHandler()
-
Method Summary
All Methods Modifier and Type Method Description Optional<BindingException>
handleException(HasValue<?,?> field, Exception exception)
Produces a
BindingException
instance based on originalexception
and field as a subject of the exception.
-
-
-
Method Detail
-
handleException
public Optional<BindingException> handleException(HasValue<?,?> field, Exception exception)
Description copied from interface:
BindingExceptionHandler
Produces a
BindingException
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
.Specified by:
handleException
in interfaceBindingExceptionHandler
Parameters:
field
- the subject of the exceptionexception
- an exception thrown within binding logicReturns:
an optional
BindingException
, or an empty optional if no additional information should be provided for the thrown exception
-
-