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

109
Views
Express no está manejando errores para la función

Estoy usando una función varias veces llamando desde diferentes rutas. Se está ejecutando pero express/node.js no maneja errores en la función.

Aquí está el ejemplo.

 # routes.js var app = express() var { test } = require('../functions/test.js')(app) router.get('/test', (req, res) => { console.log(test()) })
 # test.js function test() { return 'Hey' } module.exports = function(app){ return { test } }

Si llamo a una función en test() que no existe, no arroja errores y no devuelve nada dentro console.log(test())

 # test.js function test() { heyHeyheyHey() return 'Hey' } module.exports = function(app){ return { test } }

¿Tengo que definir este módulo en algún lugar o algo así?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Ejecuté una demostración rápida y se ha producido el error. Estoy seguro de que lo has descubierto, pero aquí está mi fragmento. ingrese la descripción de la imagen aquí

ingrese la descripción de la imagen aquí

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!