@Produces @Singleton @Requires(classes={javax.validation.ConstraintViolationException.class,ExceptionHandler.class}) public class ConstraintExceptionHandler extends java.lang.Object implements ExceptionHandler<javax.validation.ConstraintViolationException,HttpResponse<JsonError>>
ExceptionHandler
for ConstraintViolationException
.Constructor and Description |
---|
ConstraintExceptionHandler() |
Modifier and Type | Method and Description |
---|---|
protected java.lang.String |
buildMessage(javax.validation.ConstraintViolation violation)
Builds a message based on the provided violation.
|
HttpResponse<JsonError> |
handle(HttpRequest request,
javax.validation.ConstraintViolationException exception)
Handles an exception and returns the result.
|
public HttpResponse<JsonError> handle(HttpRequest request, javax.validation.ConstraintViolationException exception)
ExceptionHandler
handle
in interface ExceptionHandler<javax.validation.ConstraintViolationException,HttpResponse<JsonError>>
request
- The requestexception
- The exception typeprotected java.lang.String buildMessage(javax.validation.ConstraintViolation violation)
violation
- The constraint violation