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.

@FunctionalInterface public interface BindingExceptionHandler extends Serializable
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 Details

    • handleException

      Optional<BindingException> handleException(HasValue<?,?> field, Exception exception)
      Produces a 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.

      Parameters:
      field - the subject of the exception
      exception - 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