Class GenieExceptionMapper
java.lang.Object
com.netflix.genie.web.apis.rest.v3.controllers.GenieExceptionMapper
Exception mapper for Genie Exceptions.
- Since:
- 3.0.0
-
Constructor Summary
ConstructorsConstructorDescriptionGenieExceptionMapper
(io.micrometer.core.instrument.MeterRegistry registry) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<GeniePreconditionException>
handleConstraintViolation
(jakarta.validation.ConstraintViolationException cve) Handle constraint violation exceptions.org.springframework.http.ResponseEntity<GenieCheckedException>
HandleGenieCheckedException
instances.org.springframework.http.ResponseEntity<GenieException>
Handle Genie Exceptions.org.springframework.http.ResponseEntity<GenieRuntimeException>
Handle Genie runtime exceptions.org.springframework.http.ResponseEntity<GeniePreconditionException>
handleMethodArgumentNotValidException
(org.springframework.web.bind.MethodArgumentNotValidException e) Handle MethodArgumentNotValid exceptions.
-
Constructor Details
-
GenieExceptionMapper
@Autowired public GenieExceptionMapper(io.micrometer.core.instrument.MeterRegistry registry) Constructor.- Parameters:
registry
- The metrics registry
-
-
Method Details
-
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 aHttpStatus
-
handleGenieCheckedException
@ExceptionHandler(GenieCheckedException.class) public org.springframework.http.ResponseEntity<GenieCheckedException> handleGenieCheckedException(GenieCheckedException e) HandleGenieCheckedException
instances.- Parameters:
e
- The exception to map- Returns:
- A
ResponseEntity
with the exception mapped to aHttpStatus
-
handleConstraintViolation
@ExceptionHandler(jakarta.validation.ConstraintViolationException.class) public org.springframework.http.ResponseEntity<GeniePreconditionException> handleConstraintViolation(jakarta.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
-