Make loadJSON more robust

This commit is contained in:
Zora Franke 2024-07-24 17:40:52 +02:00
parent 11613e045a
commit 40b614b54e

View file

@ -13,6 +13,13 @@ export const loadJSON = async () => {
return data;
}
const json = await resp.json();
return json;
return resp
.json()
.then((json) => {
return json;
})
.catch((error) => {
console.warn("Loading JSON from returnd content failed, using compiled JSON as fallback.");
return data;
});
};