diff --git a/src/main/java/com/sponus/sponusbe/global/common/exception/GlobalExceptionHandler.java b/src/main/java/com/sponus/sponusbe/global/common/exception/GlobalExceptionHandler.java index 6c327e5b..31de1bb2 100644 --- a/src/main/java/com/sponus/sponusbe/global/common/exception/GlobalExceptionHandler.java +++ b/src/main/java/com/sponus/sponusbe/global/common/exception/GlobalExceptionHandler.java @@ -22,10 +22,15 @@ public class GlobalExceptionHandler { @ExceptionHandler({Exception.class}) - public ResponseEntity> handleAllException(Exception e) { + public ResponseEntity> handleAllException(Exception e) { log.error(">>>>> Internal Server Error : ", e); BaseErrorCode errorCode = GlobalErrorCode.INTERNAL_SERVER_ERROR; - return ResponseEntity.internalServerError().body(errorCode.getErrorResponse()); + ApiResponse errorResponse = ApiResponse.onFailure( + errorCode.getCode(), + errorCode.getMessage(), + e.getMessage() + ); + return ResponseEntity.internalServerError().body(errorResponse); } @ExceptionHandler({CustomException.class})