Error logging with stack trace
This commit is contained in:
29
hosts.js
29
hosts.js
@@ -42,12 +42,14 @@ async function isConnected(hostID) {
|
||||
);
|
||||
Log(`[${shared.now()}] ${hostID} connected: ${response.data.connected}`);
|
||||
return response.data.connected;
|
||||
}
|
||||
catch (error) {
|
||||
} catch (error) {
|
||||
Log(
|
||||
`[${shared.now()}] Errore nella verifica dello stato per l'host ${hostID}`
|
||||
);
|
||||
Log(`[${shared.now()}] ${error}`);
|
||||
Log(`[${shared.now()}] Errore nella verifica dello stato per l'host ${hostID}`);
|
||||
Log(`[${shared.now()}] Debug: ${error.stack}`);
|
||||
process.exit(3);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async function initHostList() {
|
||||
@@ -78,8 +80,10 @@ async function initHostList() {
|
||||
});
|
||||
} catch (error) {
|
||||
Log(
|
||||
`[${shared.now()}] Errore nella verifica e aggiunta al monitoraggio di un host: ${error}`
|
||||
`[${shared.now()}] Errore nella verifica e aggiunta al monitoraggio di un host.`
|
||||
);
|
||||
Log(`[${shared.now()}] ${error}`);
|
||||
Log(`[${shared.now()}] Debug: ${error.stack}`);
|
||||
process.exit(3);
|
||||
}
|
||||
}
|
||||
@@ -97,8 +101,10 @@ async function initHostList() {
|
||||
hostIDs.push(response.data[0].id);
|
||||
} catch (error) {
|
||||
Log(
|
||||
`[${shared.now()}] Errore nella verifica e aggiunta al monitoraggio di un host: ${error}`
|
||||
`[${shared.now()}] Errore nella verifica e aggiunta al monitoraggio di un host.`
|
||||
);
|
||||
Log(`[${shared.now()}] ${error}`);
|
||||
Log(`[${shared.now()}] Debug: ${error.stack}`);
|
||||
process.exit(3);
|
||||
}
|
||||
}
|
||||
@@ -124,8 +130,10 @@ async function initHostList() {
|
||||
hostIDs.push(response.data.id);
|
||||
} catch (error) {
|
||||
Log(
|
||||
`[${shared.now()}] Errore nella verifica e aggiunta al monitoraggio di un host: ${error}`
|
||||
`[${shared.now()}] Errore nella verifica e aggiunta al monitoraggio di un host.`
|
||||
);
|
||||
Log(`[${shared.now()}] ${error}`);
|
||||
Log(`[${shared.now()}] Debug: ${error.stack}`);
|
||||
process.exit(3);
|
||||
}
|
||||
}
|
||||
@@ -143,8 +151,10 @@ async function initHostList() {
|
||||
hostIDs.push(response.data.id);
|
||||
} catch (error) {
|
||||
Log(
|
||||
`[${shared.now()}] Errore nella verifica e aggiunta al monitoraggio di un host: ${error}`
|
||||
`[${shared.now()}] Errore nella verifica e aggiunta al monitoraggio di un host.`
|
||||
);
|
||||
Log(`[${shared.now()}] ${error}`);
|
||||
Log(`[${shared.now()}] Debug: ${error.stack}`);
|
||||
process.exit(3);
|
||||
}
|
||||
}
|
||||
@@ -164,8 +174,9 @@ async function initHostList() {
|
||||
hostIDs.push(element.id);
|
||||
});
|
||||
} catch (error) {
|
||||
Log(`[${shared.now()}] Errore nel tentativo di reperire tutti i peer.`);
|
||||
Log(`[${shared.now()}] ${error}`);
|
||||
Log(`[${shared.now()}] Errore nel tentativo di reperire tutti i peer`);
|
||||
Log(`[${shared.now()}] Debug: ${error.stack}`);
|
||||
process.exit(3);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user