Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

301
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda