Class ProblemConstraintViolationExceptionHandler

java.lang.Object
io.micronaut.problem.violations.ProblemConstraintViolationExceptionHandler
All Implemented Interfaces:
io.micronaut.http.server.exceptions.ExceptionHandler<jakarta.validation.ConstraintViolationException,io.micronaut.http.HttpResponse<?>>

@Produces @Singleton @Requires(classes={jakarta.validation.ConstraintViolationException.class,io.micronaut.http.server.exceptions.ExceptionHandler.class}) @Replaces(io.micronaut.validation.exceptions.ConstraintExceptionHandler.class) public class ProblemConstraintViolationExceptionHandler extends Object implements io.micronaut.http.server.exceptions.ExceptionHandler<jakarta.validation.ConstraintViolationException,io.micronaut.http.HttpResponse<?>>
Since:
1.0
Author:
Sergio del Amo
  • Constructor Details

    • ProblemConstraintViolationExceptionHandler

      public ProblemConstraintViolationExceptionHandler(io.micronaut.http.server.exceptions.response.ErrorResponseProcessor<?> responseProcessor)
      Constructor.
      Parameters:
      responseProcessor - Error Response Processor
  • Method Details

    • handle

      public io.micronaut.http.HttpResponse<?> handle(io.micronaut.http.HttpRequest request, jakarta.validation.ConstraintViolationException exception)
      Specified by:
      handle in interface io.micronaut.http.server.exceptions.ExceptionHandler<jakarta.validation.ConstraintViolationException,io.micronaut.http.HttpResponse<?>>
    • createViolation

      @NonNull protected @NonNull Violation createViolation(@NonNull @NonNull jakarta.validation.ConstraintViolation<?> constraintViolation)
      Parameters:
      constraintViolation - Constraint Violation
      Returns:
      A Violation