pis #1

Closed
fred.boniface wants to merge 51 commits from pis into dev
Showing only changes of commit 1d365ea374 - Show all commits

View File

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