Class EntityNotFoundErrorHandler

java.lang.Object
com.mirna.hospitalmanagementapi.infra.handlers.EntityNotFoundErrorHandler

@RestControllerAdvice public class EntityNotFoundErrorHandler extends Object
This @RestControllerAdvice is used to handle entity not found error and return appropriate response message
Version:
1.0
Author:
Mirna Gama
  • Constructor Details

    • EntityNotFoundErrorHandler

      public EntityNotFoundErrorHandler()
  • Method Details

    • handle

      @ExceptionHandler(jakarta.persistence.EntityNotFoundException.class) public org.springframework.http.ResponseEntity<Object> handle(jakarta.persistence.EntityNotFoundException exception)