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

297
Views
stopping strapi to then run a node command does nothing. What do i have to do to find out, where the error is?

enter image description here

I have the following error :

UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag \`--unhandled-rejections=strict\`
about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

Firstly, declare new object doesn't need await, so change your declare new user to const user = new User(your_object_here)

And what you mean in catch() then you throw error and catch again. Change you code to this and try again

try{
  // logic here
  res.send('ok')
}catch(error) {
  console.log('that did not go well');
  res.status(500).send('fail')
}
about 4 years ago · Juan Pablo Isaza Report

0

This error happens because you are trying to throw an error inside a catch bloc. (documentation)

If you really need to throw an error you must put another try / catch inside your catch block. But you should consider removing the throw and only print the error inside the catch and send a 500 error .

try {
  await user.save()
  res.send("ok");
} catch (Error e) {
  console.log(e);
  res.status(500).send('ko');
}
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!