Skip to content

Commit 192b5a5

Browse files
committed
fix: 채팅 요청 코드 수정 #100
- 채팅 요청 시, 상대방이 온라인이 아니면 202로 수정 - ErrorCode 추가
1 parent 9f35de8 commit 192b5a5

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

default/src/main/java/org/dfbf/soundlink/domain/chat/service/ChatRoomService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public ResponseResult saveRequestToRedis(Long requestUserId, Long emotionRecordI
107107
return new ResponseResult(ErrorCode.SUCCESS);
108108
} catch (IllegalArgumentException e) {
109109
log.info(e.getMessage());
110-
return new ResponseResult(ErrorCode.SUCCESS, "요청은 갔지만, 상대방의 SSE가 없어 알림이 전송되지 않았습니다.");
110+
return new ResponseResult(ErrorCode.CHAT_REQUEST_SSE_FAILED);
111111
} catch (EmotionRecordNotFoundException e) {
112112
return new ResponseResult(ErrorCode.FAIL_TO_FIND_EMOTION_RECORD, e.getMessage());
113113
} catch (UserNotFoundException e) {

default/src/main/java/org/dfbf/soundlink/global/exception/ErrorCode.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,9 @@ public enum ErrorCode {
7474
CHAT_FAILED(HttpStatus.CONFLICT,"서버 내부 에러. 중복된 레코드가 존재합니다."),
7575
CHAT_REQUEST_FAILED(HttpStatus.CONFLICT, "채팅 요청 실패"),
7676

77-
CONCURRENCY_ERROR(HttpStatus.INTERNAL_SERVER_ERROR, "재시도 실패. 동시성 충돌로 인해 업데이트 할 수 없습니다." );
77+
CONCURRENCY_ERROR(HttpStatus.INTERNAL_SERVER_ERROR, "재시도 실패. 동시성 충돌로 인해 업데이트 할 수 없습니다." ),
78+
79+
CHAT_REQUEST_SSE_FAILED(HttpStatus.ACCEPTED, "The other user is not online.");
7880

7981
private final HttpStatus status;
8082
private final String message;

0 commit comments

Comments
 (0)