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

204
Views
How to check if nodejs process failed due to a timeout?

I spawn a synchronous process like this:

child = spawnSync('somecommand', { stdio: 'inherit', cwd: someDir, timeout: 30000});

Is there a reliable way to check if the child process failed due to the timeout option or some other error?

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

0

If anyone runs into the same problem, there is a simple way to retrieve the timeout error code at run-time:

 if (child.error && child.error.code === "ETIMEDOUT") {
   console.log("child timed out");
 }
about 4 years ago · Juan Pablo Isaza Report

0

You should check for the log of node which is running down there somewhere. You must be running this with a cli so you can see the log there. Or you can look for where the log is saved. Everything, specially the errors are noted there.

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!