From 5a3662f9dfe7b172a1a9a911e1f9112190232978 Mon Sep 17 00:00:00 2001 From: Yan Thomas <61414485+Yan-Thomas@users.noreply.github.com> Date: Wed, 19 Jul 2023 20:58:42 -0300 Subject: [PATCH] Remove abort when `` fetch fails (#3764) --- src/components/Version.astro | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/Version.astro b/src/components/Version.astro index e47e3fc96891b..21f9882f3739e 100644 --- a/src/components/Version.astro +++ b/src/components/Version.astro @@ -1,5 +1,5 @@ --- -import pRetry, { AbortError } from 'p-retry'; +import pRetry from 'p-retry'; import { cachedFetch } from '../util-server'; export interface Props { @@ -16,7 +16,7 @@ const packageInfo = await pRetry( const json = await response.json(); if (!response.ok) { - throw new AbortError( + throw new Error( `npm API call failed: GET "${url}" returned status ${response.status}: ${JSON.stringify( json )}` @@ -25,7 +25,7 @@ const packageInfo = await pRetry( return json; }, - { retries: 5 } + { retries: 10 } ); const { version } = packageInfo;