mirror of
https://github.com/HirziDevs/PteroStats
synced 2026-08-30 04:36:53 +00:00
feat: log wings error
This commit is contained in:
@@ -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
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user