Class HelidonConstraintViolationExceptionMapper

  • All Implemented Interfaces:
    ExceptionMapper<javax.validation.ConstraintViolationException>

    @Provider
    public class HelidonConstraintViolationExceptionMapper
    extends Object
    implements ExceptionMapper<javax.validation.ConstraintViolationException>
    A JAX-RS provider that maps ConstraintViolationException from bean validation to a proper JAX-RS response with Response.Status.BAD_REQUEST status. If this provider is not present, validation exception from Validation would end with an internal server error.
    • Constructor Detail

      • HelidonConstraintViolationExceptionMapper

        public HelidonConstraintViolationExceptionMapper()
    • Method Detail

      • toResponse

        public Response toResponse​(javax.validation.ConstraintViolationException exception)
        Return Validation Exception, wrapped as a bad request.
        Specified by:
        toResponse in interface ExceptionMapper<javax.validation.ConstraintViolationException>
        Parameters:
        exception - Validation exception
        Returns:
        BAR_REQUEST Response.