From e5f37b003d93a17c2a9958697269b2d3228d8830 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Wed, 4 Mar 2026 23:06:35 -0800 Subject: tuning --- src/lib/utils.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/lib/utils.ts') diff --git a/src/lib/utils.ts b/src/lib/utils.ts index 74e05f17..9f1eec3a 100644 --- a/src/lib/utils.ts +++ b/src/lib/utils.ts @@ -46,7 +46,8 @@ export const get = (url: string, headers = {}) => { return fetch(base + url, { headers: { ...ipHeaders(), ...headers } }) .then(async (r) => { if (r.ok) return r.text(); - throw new Error(await r.text()); + const text = await r.text(); + throw new Error(text.replace(/^"|"$/g, "")); }) .then((body) => { try { @@ -84,7 +85,7 @@ export const post = async ( } catch {} if (message) throw new Error(message); - throw new Error(text); + throw new Error(text.replace(/^"|"$/g, "")); }) .then((body) => { let json; -- cgit v1.2.3