diff options
| author | Adam Soltys <[email protected]> | 2026-03-04 23:06:35 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-03-04 23:06:35 -0800 |
| commit | e5f37b003d93a17c2a9958697269b2d3228d8830 (patch) | |
| tree | e2c3a3c4d1bec48d323e830f5be35d5832845a9a /src/lib/utils.ts | |
| parent | e6882c6a8987e23215a2538b242431ae603c7101 (diff) | |
| download | coinos-ui-e5f37b003d93a17c2a9958697269b2d3228d8830.tar.gz coinos-ui-e5f37b003d93a17c2a9958697269b2d3228d8830.zip | |
tuning
Diffstat (limited to 'src/lib/utils.ts')
| -rw-r--r-- | src/lib/utils.ts | 5 |
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; |
