Company logo
  • Empleos
  • Bootcamp
  • Acerca de nosotros
  • Para profesionales
    • Inicio
    • Empleos
    • Cursos y retos
    • Preguntas
    • Profesores
    • Bootcamp
  • Para empresas
    • Inicio
    • Nuestro proceso
    • Planes
    • Pruebas
    • Nómina
    • Blog
    • Calculadora

0

52
Vistas
Stop the wrest of the javascript code when it encounters a error without stopping the entire bot

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
7 months ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

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).

7 months ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar empleo Planes Nuestro proceso Comercial
Legal
Términos y condiciones Política de privacidad
© 2023 PeakU Inc. All Rights Reserved.