From a92bd353fb352dae02ef6a93dbe5b37f76b29d19 Mon Sep 17 00:00:00 2001 From: WonyuChoi Date: Tue, 10 Sep 2024 20:11:03 +0900 Subject: [PATCH 1/3] =?UTF-8?q?=20fix:=20gym=20=EC=9A=94=EC=B2=AD=20uri=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/first/flash/climbing/gym/ui/ClimbingGymController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/first/flash/climbing/gym/ui/ClimbingGymController.java b/src/main/java/com/first/flash/climbing/gym/ui/ClimbingGymController.java index ef65e9de..5c4707a8 100644 --- a/src/main/java/com/first/flash/climbing/gym/ui/ClimbingGymController.java +++ b/src/main/java/com/first/flash/climbing/gym/ui/ClimbingGymController.java @@ -106,7 +106,7 @@ private void validateDifficulties(final List difficulties) { @ExampleObject(name = "클라이밍장 없음", value = "{\"error\": \"아이디가 1인 클라이밍장을 찾을 수 없습니다.\"}") })) }) - @GetMapping("/{gymId}") + @GetMapping("/gyms/{gymId}") public ResponseEntity getGymDetails( @PathVariable final Long gymId) { return ResponseEntity.ok(climbingGymService.findClimbingGymDetail(gymId)); From a376b18f5b56d050dc88f90f623af4e0f16fdfe7 Mon Sep 17 00:00:00 2001 From: WonyuChoi Date: Tue, 10 Sep 2024 20:11:40 +0900 Subject: [PATCH 2/3] =?UTF-8?q?=20feat:=20=EC=98=88=EC=B8=A1=EB=90=98?= =?UTF-8?q?=EC=A7=80=20=EC=95=8A=EB=8A=94=20=EC=98=88=EC=99=B8=20SC=5FINTE?= =?UTF-8?q?RNAL=5FSERVER=5FERROR=EB=A1=9C=20=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/first/flash/global/filter/TokenExceptionFilter.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/com/first/flash/global/filter/TokenExceptionFilter.java b/src/main/java/com/first/flash/global/filter/TokenExceptionFilter.java index fd2cb9d8..8319bded 100644 --- a/src/main/java/com/first/flash/global/filter/TokenExceptionFilter.java +++ b/src/main/java/com/first/flash/global/filter/TokenExceptionFilter.java @@ -8,8 +8,10 @@ import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletResponse; import java.io.IOException; +import lombok.extern.slf4j.Slf4j; import org.springframework.web.filter.OncePerRequestFilter; +@Slf4j public class TokenExceptionFilter extends OncePerRequestFilter { @Override @@ -22,11 +24,15 @@ protected void doFilterInternal(final HttpServletRequest request, handleResponse(response, HttpServletResponse.SC_UNAUTHORIZED, exception.getMessage()); } catch (final MemberNotFoundException exception) { handleResponse(response, HttpServletResponse.SC_NOT_FOUND, exception.getMessage()); + } catch (final RuntimeException exception) { + handleResponse(response, HttpServletResponse.SC_INTERNAL_SERVER_ERROR, + exception.getMessage()); } } private static void handleResponse(final HttpServletResponse response, final int scNotFound, final String exception) throws IOException { + log.error(exception); response.setCharacterEncoding("UTF-8"); response.setContentType("application/json; charset=UTF-8"); response.setStatus(scNotFound); From 572b3cfed4a15af0f5e786cc4046b4ec9ae1ff06 Mon Sep 17 00:00:00 2001 From: WonyuChoi Date: Tue, 10 Sep 2024 20:11:51 +0900 Subject: [PATCH 3/3] =?UTF-8?q?=20chore:=20=EC=97=90=EB=9F=AC=20=EB=A1=9C?= =?UTF-8?q?=EA=B7=B8=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../global/filter/handler/CustomAuthenticationEntryPoint.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/com/first/flash/global/filter/handler/CustomAuthenticationEntryPoint.java b/src/main/java/com/first/flash/global/filter/handler/CustomAuthenticationEntryPoint.java index 72b20d10..aa0511e4 100644 --- a/src/main/java/com/first/flash/global/filter/handler/CustomAuthenticationEntryPoint.java +++ b/src/main/java/com/first/flash/global/filter/handler/CustomAuthenticationEntryPoint.java @@ -14,6 +14,7 @@ public class CustomAuthenticationEntryPoint implements AuthenticationEntryPoint @Override public void commence(final HttpServletRequest request, final HttpServletResponse response, final AuthenticationException authException) throws IOException, ServletException { + log.error(authException.getMessage()); response.setStatus(HttpServletResponse.SC_UNAUTHORIZED); response.getWriter().write(authException.getMessage()); }