Skip to content

Commit 72c17a6

Browse files
committed
fix: SSE 수정
- 연결종료 & 타임아웃 로그 설정
1 parent 58bc819 commit 72c17a6

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,11 @@ public ResponseResult saveRequestToRedis(Long requestUserId, Long emotionRecordI
108108

109109
return new ResponseResult(ErrorCode.SUCCESS);
110110
} catch (EmotionRecordNotFoundException e) {
111-
return new ResponseResult(ErrorCode.FAIL_TO_FIND_EMOTION_RECORD);
111+
return new ResponseResult(ErrorCode.FAIL_TO_FIND_EMOTION_RECORD, e.getMessage());
112112
} catch (UserNotFoundException e) {
113-
return new ResponseResult(ErrorCode.FAIL_TO_FIND_USER);
113+
return new ResponseResult(ErrorCode.FAIL_TO_FIND_USER, e.getMessage());
114114
} catch (Exception e) {
115-
log.error(e.getMessage());
116-
return new ResponseResult(400, "Chat request failed.");
115+
return new ResponseResult(ErrorCode.CHAT_REQUEST_FAILED, e.getMessage());
117116
}
118117
}
119118

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ public enum ErrorCode {
7171
//채팅방 관련 에러
7272
CHAT_UNAUTHORIZED(HttpStatus.FORBIDDEN,"권한이 없습니다"),
7373
CHATROOM_NOT_FOUND(HttpStatus.NOT_FOUND,"채팅방을 찾을 수 없습니다."),
74-
CHAT_FAILED(HttpStatus.CONFLICT,"서버 내부 에러. 중복된 레코드가 존재합니다.");
74+
CHAT_FAILED(HttpStatus.CONFLICT,"서버 내부 에러. 중복된 레코드가 존재합니다."),
75+
CHAT_REQUEST_FAILED(HttpStatus.CONFLICT, "채팅 요청 실패");
7576

7677

7778
private final HttpStatus status;

0 commit comments

Comments
 (0)