From 7a5029f6b35896b5be776b85757ccd4c1d7dcdc0 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 22 Aug 2024 15:30:48 +0000 Subject: [PATCH 1/2] Create draft PR for #621 From c101206c5e51b748b2b53690c0032cb5a5638935 Mon Sep 17 00:00:00 2001 From: Do Yeop Kim <113661364+Dobby-Kim@users.noreply.github.com> Date: Fri, 23 Aug 2024 00:37:10 +0900 Subject: [PATCH 2/2] =?UTF-8?q?feat(GlobalExceptionHandler):=20=EC=B5=9C?= =?UTF-8?q?=EC=83=81=EC=9C=84=20=EB=B6=80=EB=AA=A8=20=EC=98=88=EC=99=B8=20?= =?UTF-8?q?=ED=81=B4=EB=9E=98=EC=8A=A4=20=EC=97=90=EB=9F=AC=20=ED=95=B8?= =?UTF-8?q?=EB=93=A4=EB=9F=AC=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/cruru/advice/GlobalExceptionHandler.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/backend/src/main/java/com/cruru/advice/GlobalExceptionHandler.java b/backend/src/main/java/com/cruru/advice/GlobalExceptionHandler.java index 34b192a81..1b0ce21a4 100644 --- a/backend/src/main/java/com/cruru/advice/GlobalExceptionHandler.java +++ b/backend/src/main/java/com/cruru/advice/GlobalExceptionHandler.java @@ -62,4 +62,13 @@ public ResponseEntity handleInternalServerException(InternalServe ); return ResponseEntity.of(problemDetail).build(); } + + @ExceptionHandler + public ResponseEntity handleUnexpectedException(Exception e) { + ProblemDetail problemDetail = ProblemDetail.forStatusAndDetail( + HttpStatus.INTERNAL_SERVER_ERROR, + "예기치 못한 오류가 발생하였습니다." + ); + return ResponseEntity.of(problemDetail).build(); + } }