@Produces
@Singleton
@Requires(classes={javax.validation.ConstraintViolationException.class,io.micronaut.http.server.exceptions.ExceptionHandler.class})
@Replaces(value=io.micronaut.validation.exceptions.ConstraintExceptionHandler.class)
public class ProblemConstraintViolationExceptionHandler
extends java.lang.Object
implements io.micronaut.http.server.exceptions.ExceptionHandler<javax.validation.ConstraintViolationException,io.micronaut.http.HttpResponse<?>>
Constructor and Description |
---|
ProblemConstraintViolationExceptionHandler(io.micronaut.http.server.exceptions.response.ErrorResponseProcessor<?> responseProcessor)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected Violation |
createViolation(javax.validation.ConstraintViolation<?> constraintViolation) |
io.micronaut.http.HttpResponse<?> |
handle(io.micronaut.http.HttpRequest request,
javax.validation.ConstraintViolationException exception) |
public ProblemConstraintViolationExceptionHandler(io.micronaut.http.server.exceptions.response.ErrorResponseProcessor<?> responseProcessor)
responseProcessor
- Error Response Processorpublic io.micronaut.http.HttpResponse<?> handle(io.micronaut.http.HttpRequest request, javax.validation.ConstraintViolationException exception)
handle
in interface io.micronaut.http.server.exceptions.ExceptionHandler<javax.validation.ConstraintViolationException,io.micronaut.http.HttpResponse<?>>
@NonNull protected Violation createViolation(@NonNull javax.validation.ConstraintViolation<?> constraintViolation)
constraintViolation
- Constraint Violation