Skip to content

Latest commit

 

History

History
15 lines (11 loc) · 440 Bytes

2019-05-18_debugging_execSync.md

File metadata and controls

15 lines (11 loc) · 440 Bytes

Debugging execSync in Node.js

5/18/2019

Node.js has a handy tool for executing commands, called 'execSync'. Should you encounter an execption, you may need to raise a custom error or debug the error that was raised by an exeception. To do this you can use try { ... } catch(e) { ... }

try {
  execSync('some_arbitrary_command')
} catch(e) {
  // does some custom stuff with e
}

Tags: Node, javascript, general