Skip to content

Commit 136085f

Browse files
fix(useTriggerChat): Handle rejected stream subscriptions
1 parent 6409d28 commit 136085f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/react-hooks/src/hooks/useTriggerChat.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,13 +398,16 @@ function subscribeToDataStreams(params: {
398398
if (subscribedStreams.has(stream)) continue;
399399

400400
subscribedStreams.add(stream);
401-
streamDataFromTrigger({
401+
void streamDataFromTrigger({
402402
streamKey: stream,
403403
runId,
404404
baseURL,
405405
accessToken,
406406
runAbortController,
407407
controller,
408+
}).catch((error) => {
409+
controller.error(error);
410+
runAbortController.abort();
408411
});
409412
}
410413
}

0 commit comments

Comments
 (0)