Bug fix
This commit is contained in:
parent
464ec80c2a
commit
96f9ab3a1c
@ -144,11 +144,13 @@
|
||||
}
|
||||
// fetch data and return json
|
||||
async function fetchJson(url, options = {}) {
|
||||
let response = await fetch(url, options)
|
||||
const response = await fetch(url, options)
|
||||
const json = await response.json()
|
||||
if (response.ok) {
|
||||
return await response.json()
|
||||
return json
|
||||
} else {
|
||||
throw new Error(response.statusText)
|
||||
console.error(json)
|
||||
throw new Error(json.description)
|
||||
}
|
||||
}
|
||||
function getFormattedTime(timestamp, format) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user