Skip to content

Commit 53fccf1

Browse files
authoredJul 11, 2024··
fix (ai/core): report streamText error on controller (#2242)
1 parent 67fbc8e commit 53fccf1

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed
 

‎.changeset/loud-news-sit.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'ai': patch
3+
---
4+
5+
fix (ai/core): report error on controller

‎packages/core/core/generate-text/stream-text.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,7 @@ stream will throw the error.
505505
controller.enqueue(chunk.textDelta);
506506
}
507507
} else if (chunk.type === 'error') {
508-
throw chunk.error;
508+
controller.error(chunk.error);
509509
}
510510
},
511511
});

0 commit comments

Comments
 (0)
Please sign in to comment.