Class HelidonConstraintViolationExceptionMapper
- java.lang.Object
-
- io.helidon.microprofile.bean.validation.HelidonConstraintViolationExceptionMapper
-
- All Implemented Interfaces:
ExceptionMapper<javax.validation.ConstraintViolationException>
@Provider public class HelidonConstraintViolationExceptionMapper extends Object implements ExceptionMapper<javax.validation.ConstraintViolationException>
A JAX-RS provider that mapsConstraintViolationException
from bean validation to a proper JAX-RS response withResponse.Status.BAD_REQUEST
status. If this provider is not present, validation exception from Validation would end with an internal server error.
-
-
Constructor Summary
Constructors Constructor Description HelidonConstraintViolationExceptionMapper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Response
toResponse(javax.validation.ConstraintViolationException exception)
Return Validation Exception, wrapped as a bad request.
-
-
-
Method Detail
-
toResponse
public Response toResponse(javax.validation.ConstraintViolationException exception)
Return Validation Exception, wrapped as a bad request.- Specified by:
toResponse
in interfaceExceptionMapper<javax.validation.ConstraintViolationException>
- Parameters:
exception
- Validation exception- Returns:
- BAR_REQUEST Response.
-
-