🐛 内核接口返回非 200 状态码时报错提示用户 Fix https://github.com/siyuan-note/siyuan/issues/5881

This commit is contained in:
Liang Ding 2022-09-17 00:10:32 +08:00
parent 97959de878
commit dab8e2b84e
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
6 changed files with 21 additions and 21 deletions

View file

@ -36,7 +36,7 @@ export const fetchPost = (url: string, data?: any, cb?: (response: IWebSocketDat
}
}).catch((e) => {
console.warn("fetch post error", e);
if (url === "/api/transactions" && e.message === "Failed to fetch") {
if (url === "/api/transactions" && (e.message === "Failed to fetch" || e.message === "Unexpected end of JSON input")) {
kernelError();
return;
}