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) => {
|
request.onerror = () => {
|
||||||
reject(error);
|
reject(new Error("001 Connection aborted"));
|
||||||
};
|
};
|
||||||
|
|
||||||
request.send(bufferContent || content);
|
request.send(bufferContent || content);
|
||||||
|
|
|
@ -18,8 +18,11 @@ export async function fetchURL(url, opts) {
|
||||||
},
|
},
|
||||||
...rest,
|
...rest,
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch {
|
||||||
return { status: 0 };
|
const error = new Error("000 No connection");
|
||||||
|
error.status = 0;
|
||||||
|
|
||||||
|
throw error;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (res.headers.get("X-Renew-Token") === "true") {
|
if (res.headers.get("X-Renew-Token") === "true") {
|
||||||
|
|
Loading…
Reference in New Issue