Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

217
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!