oops im stupid

This commit is contained in:
ryzetech 2023-01-18 17:36:19 +01:00
parent a51cc765ed
commit 8ba80e8156

8
app.js
View file

@ -21,9 +21,11 @@ const cache = new NodeCache({ stdTTL: config.checkperiod * 3 });
})(); })();
async function checkSpace(space) { async function checkSpace(space) {
const response = await fetch(space.endpoint); let response, data, open;
const data = await response.json(); try {
let open; response = await fetch(space.endpoint);
data = await response.json();
} catch (e) { console.error(`The space ${space.id} might not be reachable. Please check the endpoint. Error: ${e}`); }
if (!space.path) { if (!space.path) {
try { open = data.state.open; } try { open = data.state.open; }