From 07c388a762d67efb853df7c8b2ee80e5425edc58 Mon Sep 17 00:00:00 2001 From: Stefan Rinke Date: Fri, 25 Jul 2025 08:50:28 +0200 Subject: [PATCH] use text body instead of json --- src/tools.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tools.ts b/src/tools.ts index 6bfec2d..9888050 100644 --- a/src/tools.ts +++ b/src/tools.ts @@ -56,9 +56,9 @@ const authMiddleware: Middleware = { const { body, ...resOptions } = response; if (!response.ok) { const res = new Response(body, resOptions); - const errorBody = await res.json(); + const errorBody = await res.text(); return new Response( - `${response.status}, ${response.statusText}: ${errorBody ? JSON.stringify(errorBody, null, 2) : ""}`, + `${response.status}, ${response.statusText}: ${errorBody ? errorBody : ""}`, { ...resOptions, status: response.status }, ); }