| 1234567891011121314151617181920212223 |
- 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<String> FileNotFoundException(){
- return new ResponseEntity<>("The File Is Not Found Exception", HttpStatus.NOT_FOUND);
- }
-
- @ExceptionHandler(value = TvSerieNotFoundException.class)
- private ResponseEntity<String> handleTvSerieNotFoundException(){
- return new ResponseEntity<>("Movie Title Not Found Exception", HttpStatus.NOT_FOUND);
- }
-
- }
|