Improved error logging

This commit is contained in:
La Programmatrice Verde 2025-08-21 22:17:38 +02:00
parent 3d6ee7698b
commit 407a428795
2 changed files with 6 additions and 0 deletions

View File

@ -45,6 +45,7 @@ async function isConnected(hostID) {
} }
catch (error) { catch (error) {
Log(`[${shared.now()}] ${error}`); Log(`[${shared.now()}] ${error}`);
Log(`[${shared.now()}] Errore nella verifica dello stato per l'host ${hostID}`);
process.exit(3); process.exit(3);
} }
} }
@ -164,6 +165,7 @@ async function initHostList() {
}); });
} catch (error) { } catch (error) {
Log(`[${shared.now()}] ${error}`); Log(`[${shared.now()}] ${error}`);
Log(`[${shared.now()}] Errore nel tentativo di reperire tutti i peer`);
process.exit(3); process.exit(3);
} }
} }

View File

@ -38,6 +38,7 @@ async function getUserID() {
return response.data.id; return response.data.id;
} catch (error) { } catch (error) {
Log(`[${shared.now()}] ${error}`); Log(`[${shared.now()}] ${error}`);
Log(`[${shared.now()}] Errore nel reperire l'ID dell'utente corrente`);
process.exit(3); process.exit(3);
} }
} }
@ -55,6 +56,7 @@ async function deleteToken(tokenID) {
Log(`[${shared.now()}] Token con ID ${tokenID} cancellato con successo`); Log(`[${shared.now()}] Token con ID ${tokenID} cancellato con successo`);
} catch (error) { } catch (error) {
Log(`[${shared.now()}] ${error}`); Log(`[${shared.now()}] ${error}`);
Log(`[${shared.now()}] Errore nella cancellazione del token con ID ${tokenID}`);
process.exit(3); process.exit(3);
} }
} }
@ -78,6 +80,7 @@ async function getCurrentTokenID() {
return token.id; return token.id;
} catch (error) { } catch (error) {
Log(`[${shared.now()}] ${error}`); Log(`[${shared.now()}] ${error}`);
Log(`[${shared.now()}] Errore nel reperire il token corrente`);
process.exit(3); process.exit(3);
} }
} }
@ -102,6 +105,7 @@ async function getNewToken() {
return response.data.plain_token; return response.data.plain_token;
} catch (error) { } catch (error) {
Log(`[${shared.now()}] ${error}`); Log(`[${shared.now()}] ${error}`);
Log(`[${shared.now()}] Errore nella creazione di un nuovo token`);
process.exit(3); process.exit(3);
} }
} }