Skip to content

Commit

Permalink
fix: network error object message
Browse files Browse the repository at this point in the history
  • Loading branch information
ramiresviana committed May 4, 2022
1 parent 96afaca commit fc209f6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions frontend/src/api/files.js
Expand Up @@ -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);
Expand Down
7 changes: 5 additions & 2 deletions frontend/src/api/utils.js
Expand Up @@ -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") {
Expand Down

0 comments on commit fc209f6

Please sign in to comment.