Class GenieExceptionMapper


  • @ControllerAdvice
    public class GenieExceptionMapper
    extends java.lang.Object
    Exception mapper for Genie Exceptions.
    Since:
    3.0.0
    • Constructor Detail

      • GenieExceptionMapper

        @Autowired
        public GenieExceptionMapper​(io.micrometer.core.instrument.MeterRegistry registry)
        Constructor.
        Parameters:
        registry - The metrics registry
    • Method Detail

      • handleGenieException

        @ExceptionHandler(GenieException.class)
        public org.springframework.http.ResponseEntity<GenieException> handleGenieException​(GenieException e)
        Handle Genie Exceptions.
        Parameters:
        e - The exception to handle
        Returns:
        An ResponseEntity instance
      • handleGenieRuntimeException

        @ExceptionHandler(GenieRuntimeException.class)
        public org.springframework.http.ResponseEntity<GenieRuntimeException> handleGenieRuntimeException​(GenieRuntimeException e)
        Handle Genie runtime exceptions.
        Parameters:
        e - The Genie exception to handle
        Returns:
        A ResponseEntity with the exception mapped to a HttpStatus
      • handleConstraintViolation

        @ExceptionHandler(javax.validation.ConstraintViolationException.class)
        public org.springframework.http.ResponseEntity<GeniePreconditionException> handleConstraintViolation​(javax.validation.ConstraintViolationException cve)
        Handle constraint violation exceptions.
        Parameters:
        cve - The exception to handle
        Returns:
        A ResponseEntity instance
      • handleMethodArgumentNotValidException

        @ExceptionHandler(org.springframework.web.bind.MethodArgumentNotValidException.class)
        public org.springframework.http.ResponseEntity<GeniePreconditionException> handleMethodArgumentNotValidException​(org.springframework.web.bind.MethodArgumentNotValidException e)
        Handle MethodArgumentNotValid exceptions.
        Parameters:
        e - The exception to handle
        Returns:
        A ResponseEntity instance