From 447dd15e064a10795f78bc3d7e1b5291d3a8dbb5 Mon Sep 17 00:00:00 2001 From: "Alexander \"Arav\" Andreev" Date: Fri, 26 Nov 2021 19:25:36 +0400 Subject: [PATCH] Changed internal domain names and enclosured getProcesses' content in try catch block so no 500 error occur at least because of that. --- homepage/index.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/homepage/index.js b/homepage/index.js index 291d41f..b7d1231 100644 --- a/homepage/index.js +++ b/homepage/index.js @@ -33,9 +33,13 @@ const articles_meta = { }; async function getProcesses() { - let reimu = await fetch("http://reimu.arav.home:14882/processes").then(r => r.json()); - let sakuya = await fetch("http://sakuya.arav.home:14882/processes").then(r => r.json()); - return Object.fromEntries(Object.entries(reimu).concat(Object.entries(sakuya))); + try { + let reimu = await fetch("http://reimu.arav.home.arpa:14882/processes").then(r => r.json()); + let sakuya = await fetch("http://sakuya.arav.home.arpa:14882/processes").then(r => r.json()); + return Object.fromEntries(Object.entries(reimu).concat(Object.entries(sakuya))); + } catch { + return []; + } } function setRoutes() {