Merge pull request #6 from Gyubin-Han/feature/frontend

feature/frontend:2
This commit is contained in:
Gyubin Han
2025-06-18 01:22:52 +09:00
committed by GitHub

View File

@@ -0,0 +1,16 @@
package be.gyu.urlShortener.advice;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import be.gyu.urlShortener.exception.ShortUrlNotFoundException;
import jakarta.servlet.http.HttpServletResponse;
@ControllerAdvice(basePackages={"be.gyu.urlShortener.controller"})
public class ExceptionHandlerAdvice {
@ExceptionHandler(ShortUrlNotFoundException.class)
public void ShortUrlNotFoundExceptionHandler(HttpServletResponse response){
response.setStatus(HttpStatus.NOT_FOUND.value());
}
}