Class ValidationErrorHandler

java.lang.Object
com.mirna.hospitalmanagementapi.infra.handlers.validation.ValidationErrorHandler

@RestControllerAdvice public class ValidationErrorHandler extends Object
This @RestControllerAdvice is used to handle validation errors and return appropriate response messages
Version:
1.0
Author:
Mirna Gama
  • Constructor Details

    • ValidationErrorHandler

      public ValidationErrorHandler()
  • Method Details

    • handle

      @ResponseStatus(code=BAD_REQUEST) @ExceptionHandler(org.springframework.web.bind.MethodArgumentNotValidException.class) public org.springframework.http.ResponseEntity<Object> handle(org.springframework.web.bind.MethodArgumentNotValidException expection)