From 87e20f90c04dc2e44a2bd66372070cc6da94f08b Mon Sep 17 00:00:00 2001 From: guysaar223 Date: Wed, 16 Oct 2024 23:37:55 +0300 Subject: [PATCH] retry when res is not ok --- src/scope/network/http/http.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/scope/network/http/http.ts b/src/scope/network/http/http.ts index 6452e9d58c3d..9756a6d64bc7 100644 --- a/src/scope/network/http/http.ts +++ b/src/scope/network/http/http.ts @@ -372,6 +372,7 @@ export class Http implements Network { const res = await retry( async () => { const retiedRes = await _fetch(urlToFetch, opts); + if (!retiedRes.ok) throw new Error(`${retiedRes.status} - ${retiedRes.statusText}`); return retiedRes; }, {