[feat] added error message

This commit is contained in:
kwaroran
2023-07-17 14:22:52 +09:00
parent 4e3817086b
commit 7380d4b72a
3 changed files with 219 additions and 213 deletions

View File

@@ -662,9 +662,10 @@ export async function globalFetch(url:string, arg:{plainFetchForce?:boolean,body
}
} catch (error) {
addFetchLog(daText, false)
let errorMsg = (daText.startsWith('<!DOCTYPE')) ? ("Responded HTML. is your url, api key and password correct?") : (daText)
return {
ok:false,
data: daText,
data: errorMsg,
headers: Object.fromEntries(da.headers)
}
}