Skip to content

Commit a806438

Browse files
authored
Merge pull request #24 from Nexters/feat/#23
[Feat/#23] 리액트 쿼리가 에러를 감지하지 못하는 현상
2 parents e0a38d1 + 51b8791 commit a806438

File tree

6 files changed

+6
-6
lines changed

6 files changed

+6
-6
lines changed

src/chat/apis/createChatRoom.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,6 @@ export const createChatRoom = () => {
3636
.then((res) => validate(res.data))
3737
.catch((error) => {
3838
console.error(error);
39-
return undefined;
39+
throw error;
4040
});
4141
};

src/chat/apis/getChatMessagesByRoomId.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,6 @@ export const getChatMessagesByRoomId = (roomId: number) => {
4545
.then((res) => validate(res.data))
4646
.catch((error) => {
4747
console.error(error);
48-
return undefined;
48+
throw error;
4949
});
5050
};

src/chat/apis/sendChatMessage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,6 @@ export const sendChatMessage = (request: SendChatMessageRequest) => {
4343
.then((res) => validate(res.data))
4444
.catch((error) => {
4545
console.error(error);
46-
return undefined;
46+
throw error;
4747
});
4848
};

src/tarot/apis/getTarotQuestionRecommends.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,6 @@ export const getTarotQuestionRecommends = async () => {
3232
.then((res) => validate(res.data))
3333
.catch((error) => {
3434
console.error(error);
35-
return undefined;
35+
throw error;
3636
});
3737
};

src/tarot/apis/getTarotReadingResultById.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,6 @@ export const getTarotReadingResultById = async (resultId: number) => {
5151
.then((res) => validate(res.data))
5252
.catch((error) => {
5353
console.error(error);
54-
return undefined;
54+
throw error;
5555
});
5656
};

src/tarot/apis/selectTarotCard.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,6 @@ export const selectTarotCard = async (request: SelectTarotCardRequest) => {
4141
.then((res) => validate(res.data))
4242
.catch((error) => {
4343
console.error(error);
44-
return undefined;
44+
throw error;
4545
});
4646
};

0 commit comments

Comments
 (0)