Update packages/core/src/utils/fetch.ts

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This commit is contained in:
PROTHAM 2026-03-31 15:16:38 +05:30 committed by GitHub
parent 1817e36806
commit d412410088
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -186,9 +186,7 @@ export async function fetchWithTimeout(
// cancellation (e.g. Ctrl+C), not an internal timeout. Re-throw as a plain
// AbortError so the retry layer does NOT treat it as a retryable ETIMEDOUT.
if (options?.signal?.aborted) {
const abortError = new Error('The operation was aborted.');
abortError.name = 'AbortError';
throw abortError;
throw options.signal.reason ?? error;
}
throw new FetchError(`Request timed out after ${timeout}ms`, 'ETIMEDOUT');
}