diff --git a/frontend/src/api/files.js b/frontend/src/api/files.js index 490771235e..7b885cfab3 100644 --- a/frontend/src/api/files.js +++ b/frontend/src/api/files.js @@ -111,8 +111,8 @@ export async function post(url, content = "", overwrite = false, onupload) { } }; - request.onerror = (error) => { - reject(error); + request.onerror = () => { + reject(new Error("001 Connection aborted")); }; request.send(bufferContent || content); diff --git a/frontend/src/api/utils.js b/frontend/src/api/utils.js index 4319e8ff15..549a74ecb4 100644 --- a/frontend/src/api/utils.js +++ b/frontend/src/api/utils.js @@ -18,8 +18,11 @@ export async function fetchURL(url, opts) { }, ...rest, }); - } catch (error) { - return { status: 0 }; + } catch { + const error = new Error("000 No connection"); + error.status = 0; + + throw error; } if (res.headers.get("X-Renew-Token") === "true") {