From 53d5f8efa2670fbce4e525dc0ca9c35ca0fd40fb Mon Sep 17 00:00:00 2001 From: Arnaud Date: Mon, 7 Oct 2024 13:14:49 +0200 Subject: [PATCH] Fix bug when trying to get the text response on failure --- src/fetch-safe/fetch-safe.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fetch-safe/fetch-safe.ts b/src/fetch-safe/fetch-safe.ts index 3aa31d4..1e2e4b7 100644 --- a/src/fetch-safe/fetch-safe.ts +++ b/src/fetch-safe/fetch-safe.ts @@ -16,7 +16,7 @@ export const Fetch = { } if (!res.data.ok) { - const message = await Promises.safe(res.data.text); + const message = await Promises.safe(() => res.data.text()); if (message.error) { return message;