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

128
Views
App was killed with setTimeout callback func on express.js

I have short question.

router.get('/', function(req, res, next) {
  throw new Error('123')
  res.send('respond with a resource');
});

When I call this snippet on express project. It throw error what I expected.

But

router.get('/', function(req, res, next) {
  setTimeout(() => {
    throw new Error('123')
  }, 1000)
  res.send('respond with a resource');
});

With this code express process killed with Command failed with exit code 1. this message.

What keywords should I study is? What am I missing?

Thank you.

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

0

1.The default error handler http://expressjs.com/en/guide/error-handling.html

2.callback error handler try/catch issues with nested functons in javascript

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!