Skip to content

Commit

Permalink
fix JSON parse error
Browse files Browse the repository at this point in the history
  • Loading branch information
czzonet committed Jan 10, 2023
1 parent d4067ca commit 384db42
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,13 @@ export async function browserPostEventStream(
messageId
})
}
try {
const checkJson = JSON.parse(data)
} catch (error) {
console.log('warning: parse error.')

return
}
try {
const convoResponseEvent: types.ConversationResponseEvent =
JSON.parse(data)
Expand Down

0 comments on commit 384db42

Please sign in to comment.