Skip to content

Commit

Permalink
fix: simple network error result
Browse files Browse the repository at this point in the history
  • Loading branch information
KeJunMao committed Mar 23, 2023
1 parent 8c4d991 commit 0ee3f02
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion composables/useChatGPT.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,11 @@ export const useChatGPT = createSharedComposable(() => {
resp = (await createFetchGPTResponse(options, messages, signal)) as any;
} catch (error: any) {
isError = true;
resp = error.data;
if (error.data) {
resp = error.data;
} else {
throw error;
}
}
const parser = createParser((event) => {
if (event.type === "event") {
Expand Down

0 comments on commit 0ee3f02

Please sign in to comment.