Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

219
Visualizações
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
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

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

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda