@RestControllerAdvice
public class ConstraintViolationExceptionHandler
Represents the REST controller that handles ConstraintViolationException and returns an appropriate HTTP response.
annotationclass ExceptionHandler| Constructor and Description |
|---|
ConstraintViolationExceptionHandler(ValiktorConfiguration config)
Represents the REST controller that handles ConstraintViolationException and returns an appropriate HTTP response.
|
| Modifier and Type | Method and Description |
|---|---|
org.springframework.http.ResponseEntity<org.valiktor.springframework.web.payload.UnprocessableEntity> |
handleConstraintViolationException(org.valiktor.ConstraintViolationException ex,
java.util.Locale locale)
Handle ConstraintViolationException and returns 422 (Unprocessable Entity) status code
with the constraint violations.
|
public ConstraintViolationExceptionHandler(@NotNull
ValiktorConfiguration config)
Represents the REST controller that handles ConstraintViolationException and returns an appropriate HTTP response.
config - specifies the class ValiktorConfigurationannotationclass ExceptionHandler@ExceptionHandler
@NotNull
public org.springframework.http.ResponseEntity<org.valiktor.springframework.web.payload.UnprocessableEntity> handleConstraintViolationException(@NotNull
org.valiktor.ConstraintViolationException ex,
@Nullable
java.util.Locale locale)
Handle ConstraintViolationException and returns 422 (Unprocessable Entity) status code with the constraint violations.
ex - specifies the ConstraintViolationExceptionlocale - specifies the Locale of the Request