From 024ee06b34e2ac6289f0fa2cf6653382277722d6 Mon Sep 17 00:00:00 2001 From: Philippe Virouleau <philippe.virouleau@inria.fr> Date: Mon, 25 Nov 2024 11:24:31 +0100 Subject: [PATCH] wip --- src/lib/requests.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/requests.ts b/src/lib/requests.ts index a1ed032..cfb3c8b 100644 --- a/src/lib/requests.ts +++ b/src/lib/requests.ts @@ -2,9 +2,9 @@ export function defaultFetch(url: string, options = {}) { return fetch(url, options).then(r => { if (!r.ok) { const error = new Error( - `An error ${r.status} occurred while fetching data` + `An error ${r.status} occurred while fetching data`, + { cause: r.statusText } ); - error.cause = r.statusText; throw error; } return r.json(); -- GitLab