pis #2
@ -151,17 +151,17 @@ async function getApi(path,auth = false) {
|
||||
log(`resp.status: ${resp.status}`)
|
||||
log(`resp.json: ${json}`)
|
||||
if (resp.status != 200) {
|
||||
log(`lib.main: getApi: Response status: ${resp.status}`)
|
||||
return resp.status
|
||||
}
|
||||
if (!resp.ok) {
|
||||
log(`lib.main: getApi: Fetch error`)
|
||||
return false
|
||||
}
|
||||
if (json === "[]") {
|
||||
return 'empty'
|
||||
}
|
||||
return json;
|
||||
} catch(err) {
|
||||
return false
|
||||
log(`lib.main: getApi: Caught fetch error. Status: ${resp.status}`)
|
||||
return resp.status
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user