diff --git a/handlers/getWingsStatus.js b/handlers/getWingsStatus.js index f925eaf..69975df 100644 --- a/handlers/getWingsStatus.js +++ b/handlers/getWingsStatus.js @@ -1,3 +1,5 @@ +const config = require("./config.js"); + module.exports = async function getWingsStatus(node, nodeToken) { return fetch(`${node.attributes.scheme}://${node.attributes.fqdn}:${node.attributes.daemon_listen}/api/servers`, { method: "GET", @@ -8,5 +10,8 @@ module.exports = async function getWingsStatus(node, nodeToken) { }) .then((res) => res.json()) .then(() => true) - .catch(() => false) + .catch((error) => { + if (config.log_error) console.error(error); + return false + }) } \ No newline at end of file