diff options
author | Adrian Lang <mail@adrianlang.de> | 2013-08-14 21:31:33 +0200 |
---|---|---|
committer | Fedor Indutny <fedor@indutny.com> | 2014-05-02 22:57:16 +0400 |
commit | 044da47353ea191f8521307abe1cd5c06f28efa2 (patch) | |
tree | d577fcd388e8da5bf2dceac40975d58b4c4b5b12 /doc | |
parent | d3204b0225f9087cf419c69abeab7d1586e6af5d (diff) | |
download | android-node-v8-044da47353ea191f8521307abe1cd5c06f28efa2.tar.gz android-node-v8-044da47353ea191f8521307abe1cd5c06f28efa2.tar.bz2 android-node-v8-044da47353ea191f8521307abe1cd5c06f28efa2.zip |
doc: correct check for failed child_process.spawn
Since 0.10.x, exec failures are no longer signaled through stderr,
but rather as error events.
Signed-off-by: Fedor Indutny <fedor@indutny.com>
Diffstat (limited to 'doc')
-rw-r--r-- | doc/api/child_process.markdown | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/doc/api/child_process.markdown b/doc/api/child_process.markdown index e1d6c1f852..ea90331a21 100644 --- a/doc/api/child_process.markdown +++ b/doc/api/child_process.markdown @@ -378,11 +378,8 @@ Example of checking for failed exec: var spawn = require('child_process').spawn, child = spawn('bad_command'); - child.stderr.setEncoding('utf8'); - child.stderr.on('data', function (data) { - if (/^execvp\(\)/.test(data)) { - console.log('Failed to start child process.'); - } + child.on('error', function (err) { + console.log('Failed to start child process.'); }); Note that if spawn receives an empty options object, it will result in |