From ddce1e488081db684d5749c7e2227f2f688ec942 Mon Sep 17 00:00:00 2001 From: Photogrammer <81505228+JuneParkCode@users.noreply.github.com> Date: Fri, 23 Aug 2024 10:50:07 +0900 Subject: [PATCH] =?UTF-8?q?[FEAT]=20Exception=20Handler=20=EC=97=90?= =?UTF-8?q?=EC=84=9C=20Exception.class=20=EC=97=90=20=EB=8C=80=ED=95=9C=20?= =?UTF-8?q?=EC=B2=98=EB=A6=AC=20(#105)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes #101 --- .../common/exception/handler/RestControllerAdvice.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/server/src/main/java/com/talkka/server/common/exception/handler/RestControllerAdvice.java b/server/src/main/java/com/talkka/server/common/exception/handler/RestControllerAdvice.java index 0b447e04..a5db44f1 100644 --- a/server/src/main/java/com/talkka/server/common/exception/handler/RestControllerAdvice.java +++ b/server/src/main/java/com/talkka/server/common/exception/handler/RestControllerAdvice.java @@ -31,6 +31,12 @@ public ResponseEntity handleInvalidEnumCodeException(InvalidEnumCodeExce return new ResponseEntity<>(INTERNAL_SERVER_ERROR_MESSAGE, HttpStatus.INTERNAL_SERVER_ERROR); } + @ExceptionHandler(Exception.class) + public ResponseEntity handleException(Exception exception) { + log.error("Exception: {}", exception.getMessage()); + return new ResponseEntity<>(INTERNAL_SERVER_ERROR_MESSAGE, HttpStatus.INTERNAL_SERVER_ERROR); + } + @Deprecated @ExceptionHandler(HttpBaseException.class) public ResponseEntity> handleHttpException(HttpBaseException exception) {