diff --git a/client/api/Client.ts b/client/api/Client.ts index b88886c..7f2bd6b 100644 --- a/client/api/Client.ts +++ b/client/api/Client.ts @@ -165,8 +165,15 @@ class Client { body: form, credentials: 'omit', }) + const text = await (await re.blob()).text() + let json + try { + json = JSON.parse(text) + } catch(_) {} return { - ...await re.json(), + ...(json == null ? { + msg: text + } : json), code: re.status, } as ApiCallbackMessage }