Class HelidonConstraintViolationExceptionMapper
java.lang.Object
io.helidon.microprofile.bean.validation.HelidonConstraintViolationExceptionMapper
- All Implemented Interfaces:
ExceptionMapper<jakarta.validation.ConstraintViolationException>
@Provider
public class HelidonConstraintViolationExceptionMapper
extends Object
implements ExceptionMapper<jakarta.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 Summary
-
Method Summary
Modifier and TypeMethodDescriptiontoResponse
(jakarta.validation.ConstraintViolationException exception) Return Validation Exception, wrapped as a bad request.
-
Constructor Details
-
HelidonConstraintViolationExceptionMapper
public HelidonConstraintViolationExceptionMapper()
-
-
Method Details
-
toResponse
Return Validation Exception, wrapped as a bad request.- Specified by:
toResponse
in interfaceExceptionMapper<jakarta.validation.ConstraintViolationException>
- Parameters:
exception
- Validation exception- Returns:
- BAR_REQUEST Response.
-