Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

@ai-sdk/provider-utils

Package Overview
Dependencies
Maintainers
3
Versions
227
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ai-sdk/provider-utils - npm Package Compare versions

Comparing version
4.0.9
to
4.0.10
+6
-0
CHANGELOG.md
# @ai-sdk/provider-utils
## 4.0.10
### Patch Changes
- 462ad00: fix(provider-utils): recognize bun fetch errors as retryable
## 4.0.9

@@ -4,0 +10,0 @@

+1
-1
{
"name": "@ai-sdk/provider-utils",
"version": "4.0.9",
"version": "4.0.10",
"license": "Apache-2.0",

@@ -5,0 +5,0 @@ "sideEffects": false,

@@ -6,2 +6,25 @@ import { APICallError } from '@ai-sdk/provider';

const BUN_ERROR_CODES = [
'ConnectionRefused',
'ConnectionClosed',
'FailedToOpenSocket',
'ECONNRESET',
'ECONNREFUSED',
'ETIMEDOUT',
'EPIPE',
];
function isBunNetworkError(error: unknown): error is Error & { code?: string } {
if (!(error instanceof Error)) {
return false;
}
const code = (error as any).code;
if (typeof code === 'string' && BUN_ERROR_CODES.includes(code)) {
return true;
}
return false;
}
export function handleFetchError({

@@ -39,3 +62,13 @@ error,

if (isBunNetworkError(error)) {
return new APICallError({
message: `Cannot connect to API: ${error.message}`,
cause: error,
url,
requestBodyValues,
isRetryable: true,
});
}
return error;
}

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display