increased logging verbosity (with and without DEBUG env variable), added logic to exit bot and restart container on unhandled errors

This commit is contained in:
2026-03-13 23:39:54 +11:00
parent c2a88804ad
commit 6c9c253a70

View File

@@ -63,7 +63,9 @@ module.exports.handleMessageCreate = async function(message) {
}
}
catch(error) {
console.error(error);
if(process.env.DEBUG == "TRUE"){console.error("An error occurred at unix timestamp " + Date.now() + "while processing the command: " + command + " with error:" + error);}
else{console.error(error);}
process.exit(2); //need this for now just to make sure the bot continues to restart on errors, since it would seem that fluxer.js doesn't define custom error types. TODO: map out some exit codes
}
}