Skip to content

Commit

Permalink
fix (ai/provider-utils): generalize to Error (DomException not always…
Browse files Browse the repository at this point in the history
… available) (#2205)
  • Loading branch information
lgrammel committed Jul 8, 2024
1 parent 7e83d75 commit d481729
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/mean-owls-exist.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@ai-sdk/provider-utils': patch
---

fix (ai/provider-utils): generalize to Error (DomException not always available)
4 changes: 2 additions & 2 deletions packages/provider-utils/src/is-abort-error.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export function isAbortError(error: unknown): error is DOMException {
export function isAbortError(error: unknown): error is Error {
return (
error instanceof DOMException &&
error instanceof Error &&
(error.name === 'AbortError' || error.name === 'TimeoutError')
);
}

0 comments on commit d481729

Please sign in to comment.