fix: response err data: url

This commit is contained in:
Gabe Yuan
2024-04-12 11:47:22 +08:00
parent f00e8ffa4d
commit 3b0cbc53aa

View File

@@ -139,9 +139,11 @@ export const fetchData = async (
res = await fetchApi({ input, init, transOpts, apiSetting });
}
if (!res?.ok) {
if (!res) {
throw new Error("Unknow error");
} else if (!res.ok) {
const msg = {
url: input,
url: res.url,
status: res.status,
};
if (res.headers.get("Content-Type")?.includes("json")) {