package fr.natan.akkastreamfileprocessingapi.exceptionshandler; import fr.natan.akkastreamfileprocessingapi.businessexceptions.FileNotFoundException; import fr.natan.akkastreamfileprocessingapi.businessexceptions.TvSerieNotFoundException; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.ControllerAdvice; import org.springframework.web.bind.annotation.ExceptionHandler; @ControllerAdvice public class BusinessExceptionHandler { @ExceptionHandler(value = FileNotFoundException.class) private ResponseEntity FileNotFoundException(){ return new ResponseEntity<>("The File Is Not Found Exception", HttpStatus.NOT_FOUND); } @ExceptionHandler(value = TvSerieNotFoundException.class) private ResponseEntity handleTvSerieNotFoundException(){ return new ResponseEntity<>("Movie Title Not Found Exception", HttpStatus.NOT_FOUND); } }