Hello im running a discord.js bot in version 12 and I want it so if it encounters a error it stops the rest of that command from running without stopping the entire bot it self this is my current code:
async function startApp () {
const currentUser = await noblox.setCookie(args.join(" "))
.catch( (err) => {
message.channel.send("Invaild or Expired data")
})
// rest of the program
You would have to do
process.on("uncaughtException", console.error);
in the index of your bot. This would log any error without stopping the bot, no matter the error (provided you don't do process.exit()
somewhere in your bot).