Skip to content

Commit 738481d

Browse files
committed
!hotfix: 핸들러에서 에러 메세지 출력하도록 수정
1 parent bf13883 commit 738481d

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/main/java/com/sponus/sponusbe/global/common/exception/GlobalExceptionHandler.java

+7-2
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,15 @@
2222
public class GlobalExceptionHandler {
2323

2424
@ExceptionHandler({Exception.class})
25-
public ResponseEntity<ApiResponse<Void>> handleAllException(Exception e) {
25+
public ResponseEntity<ApiResponse<String>> handleAllException(Exception e) {
2626
log.error(">>>>> Internal Server Error : ", e);
2727
BaseErrorCode errorCode = GlobalErrorCode.INTERNAL_SERVER_ERROR;
28-
return ResponseEntity.internalServerError().body(errorCode.getErrorResponse());
28+
ApiResponse<String> errorResponse = ApiResponse.onFailure(
29+
errorCode.getCode(),
30+
errorCode.getMessage(),
31+
e.getMessage()
32+
);
33+
return ResponseEntity.internalServerError().body(errorResponse);
2934
}
3035

3136
@ExceptionHandler({CustomException.class})

0 commit comments

Comments
 (0)