Skip to content

Commit d481729

Browse files
authoredJul 8, 2024··
fix (ai/provider-utils): generalize to Error (DomException not always available) (#2205)
1 parent 7e83d75 commit d481729

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed
 

‎.changeset/mean-owls-exist.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@ai-sdk/provider-utils': patch
3+
---
4+
5+
fix (ai/provider-utils): generalize to Error (DomException not always available)
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
export function isAbortError(error: unknown): error is DOMException {
1+
export function isAbortError(error: unknown): error is Error {
22
return (
3-
error instanceof DOMException &&
3+
error instanceof Error &&
44
(error.name === 'AbortError' || error.name === 'TimeoutError')
55
);
66
}

0 commit comments

Comments
 (0)
Please sign in to comment.