oops im stupid
This commit is contained in:
parent
a51cc765ed
commit
8ba80e8156
1 changed files with 5 additions and 3 deletions
8
app.js
8
app.js
|
@ -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; }
|
||||||
|
|
Loading…
Reference in a new issue