aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/utils.ts
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-03-04 23:06:35 -0800
committerAdam Soltys <[email protected]>2026-03-04 23:06:35 -0800
commite5f37b003d93a17c2a9958697269b2d3228d8830 (patch)
treee2c3a3c4d1bec48d323e830f5be35d5832845a9a /src/lib/utils.ts
parente6882c6a8987e23215a2538b242431ae603c7101 (diff)
downloadcoinos-ui-e5f37b003d93a17c2a9958697269b2d3228d8830.tar.gz
coinos-ui-e5f37b003d93a17c2a9958697269b2d3228d8830.zip
tuning
Diffstat (limited to 'src/lib/utils.ts')
-rw-r--r--src/lib/utils.ts5
1 files changed, 3 insertions, 2 deletions
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;