Skip to content

Commit

Permalink
!hotfix: 핸들러에서 에러 메세지 출력하도록 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
kimday0326 committed Jan 30, 2024
1 parent bf13883 commit 738481d
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,15 @@
public class GlobalExceptionHandler {

@ExceptionHandler({Exception.class})
public ResponseEntity<ApiResponse<Void>> handleAllException(Exception e) {
public ResponseEntity<ApiResponse<String>> handleAllException(Exception e) {
log.error(">>>>> Internal Server Error : ", e);
BaseErrorCode errorCode = GlobalErrorCode.INTERNAL_SERVER_ERROR;
return ResponseEntity.internalServerError().body(errorCode.getErrorResponse());
ApiResponse<String> errorResponse = ApiResponse.onFailure(
errorCode.getCode(),
errorCode.getMessage(),
e.getMessage()
);
return ResponseEntity.internalServerError().body(errorResponse);
}

@ExceptionHandler({CustomException.class})
Expand Down

0 comments on commit 738481d

Please sign in to comment.