| 12345678910111213141516171819202122 |
- package fr.natan.akkastreamfileprocessingapi.exceptionshandler;
-
- import fr.natan.akkastreamfileprocessingapi.businessexceptions.FileNotFoundException;
- import fr.natan.akkastreamfileprocessingapi.businessexceptions.MovieNotFoundException;
- 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 = MovieNotFoundException.class)
- private ResponseEntity<String> handleMovieNotFoundException(){
- return new ResponseEntity<>("Movie Title Not Found Exception", HttpStatus.NOT_FOUND);
- }
- }
|