mirror of
https://github.com/filebrowser/filebrowser.git
synced 2024-06-07 23:00:43 +00:00
fix: network error object message
This commit is contained in:
parent
96afaca0ad
commit
fc209f64de
@ -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);
|
||||
|
@ -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") {
|
||||
|
Loading…
Reference in New Issue
Block a user