Class DefaultBindingExceptionHandler

    • Constructor Detail

      • DefaultBindingExceptionHandler

        public DefaultBindingExceptionHandler()
    • Method Detail

      • handleException

        public Optional<BindingException> handleException​(HasValue<?,​?> field,
                                                          Exception exception)
        Description copied from interface: BindingExceptionHandler
        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.

        Specified by:
        handleException in interface BindingExceptionHandler
        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