Skip to content

Commit

Permalink
fix: 좋아요 알림 전송 실패 케이스 분리
Browse files Browse the repository at this point in the history
  • Loading branch information
jjunjji committed Sep 14, 2023
1 parent b572cc6 commit 81cd0ca
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ public BaseResponse<BoardDto.GetBoardMapAndSchool> showBoardMapList(Principal pr
public BaseResponse<String> like(Principal principal,@PathVariable Long boardIdx) {
try{
String str = this.boardService.likeBoard(principal, boardIdx);

//좋아요 알림 전송 실패 케이스 분리
if(str.equals("해당 게시글에 좋아요를 눌렀지만 알림 전송에는 실패했습니다.")){
return new BaseResponse(false, 5003, str);
}

return new BaseResponse<>(str);
} catch (BaseException e) {
return new BaseResponse<>(e.getStatus());
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/com/back/handsUp/service/BoardService.java
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,8 @@ public String likeBoard(Principal principal, Long boardIdx) throws BaseException
} catch (Exception e) {
e.printStackTrace();
log.info("ERROR MESSAGE : {}", e.getMessage());
throw new BaseException(BaseResponseStatus.PUSH_NOTIFICATION_SEND_ERROR);
return "해당 게시글에 좋아요를 눌렀지만 알림 전송에는 실패했습니다.";
// throw new BaseException(BaseResponseStatus.PUSH_NOTIFICATION_SEND_ERROR);
}
}
return "해당 게시글에 좋아요를 눌렀습니다.";
Expand Down

0 comments on commit 81cd0ca

Please sign in to comment.