From b586ae95bdf3b5331e6210f2b8c8e7e69fb37059 Mon Sep 17 00:00:00 2001 From: wjddn2165 Date: Wed, 21 Aug 2024 23:43:42 +0900 Subject: [PATCH] =?UTF-8?q?chore:=20GlobalExceptionHandler=20=EC=97=90?= =?UTF-8?q?=EC=84=9C=20error=20=EB=A1=9C=EA=B9=85=ED=95=A0=20=EB=95=8C=20t?= =?UTF-8?q?race=20=EB=8A=94=20=EC=B6=9C=EB=A0=A5=ED=95=98=EC=A7=80=20?= =?UTF-8?q?=EC=95=8A=EB=8F=84=EB=A1=9D=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../global/error/GlobalExceptionHandler.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Server/src/main/java/JGS/CasperEvent/global/error/GlobalExceptionHandler.java b/Server/src/main/java/JGS/CasperEvent/global/error/GlobalExceptionHandler.java index df0cc858..ce2addb4 100644 --- a/Server/src/main/java/JGS/CasperEvent/global/error/GlobalExceptionHandler.java +++ b/Server/src/main/java/JGS/CasperEvent/global/error/GlobalExceptionHandler.java @@ -17,7 +17,7 @@ public class GlobalExceptionHandler { @ExceptionHandler(CustomException.class) public ResponseEntity handler(CustomException e){ - log.error("CustomException [{}]", e.getMessage(), e); + log.error("CustomException: {} {}", e.getErrorCode(), e.getMessage()); return ResponseEntity .status(HttpStatus.valueOf(e.getErrorCode().getStatus())) .body(ErrorResponse.of(e.getErrorCode(), e.getMessage())); @@ -25,7 +25,7 @@ public ResponseEntity handler(CustomException e){ @ExceptionHandler(MethodArgumentNotValidException.class) public ResponseEntity methodArgumentNotValidExceptionHandler(MethodArgumentNotValidException e){ - log.error("MethodArgumentNotValidException [{}]", e.getMessage(), e); + log.error("MethodArgumentNotValidException: [{}]", e.getMessage()); BindingResult bindingResult = e.getBindingResult(); StringBuilder builder = new StringBuilder(); @@ -43,7 +43,7 @@ public ResponseEntity methodArgumentNotValidExceptionHandler(Meth @ExceptionHandler(RuntimeException.class) public ResponseEntity runtimeExceptionHandler(RuntimeException e){ - log.error("RuntimeException [{}]", e.getMessage(), e); + log.error("RuntimeException: [{}]", e.getMessage()); return ResponseEntity .status(HttpStatus.BAD_REQUEST) .body(ErrorResponse.of(CustomErrorCode.BAD_REQUEST, e.getMessage())); @@ -51,7 +51,7 @@ public ResponseEntity runtimeExceptionHandler(RuntimeException e) @ExceptionHandler(JDBCConnectionException.class) public ResponseEntity handleJDBCConnectionException(JDBCConnectionException e) { - log.error("데이터베이스 연결 에러 [{}]", e.getMessage(), e); + log.error("JDBCConnectionException: [{}]", e.getMessage()); return ResponseEntity .status(HttpStatus.BAD_REQUEST) .body(ErrorResponse.of(CustomErrorCode.BAD_REQUEST, e.getMessage())); @@ -60,7 +60,7 @@ public ResponseEntity handleJDBCConnectionException(JDBCConnectio @ExceptionHandler(Exception.class) public ResponseEntity handleAllExceptions(Exception e) { - log.error("예외 발생 [{}] ", e.getMessage(), e); + log.error("Exception: {}", e.getMessage()); return ResponseEntity .status(HttpStatus.BAD_REQUEST) .body(ErrorResponse.of(CustomErrorCode.BAD_REQUEST, e.getMessage()));