diff options
author | Gireesh Punathil <gpunathi@in.ibm.com> | 2018-03-12 14:02:40 +0530 |
---|---|---|
committer | Gireesh Punathil <gpunathi@in.ibm.com> | 2018-03-15 20:47:45 +0530 |
commit | 11b6c0de4114fa499bcffbda91d8cea9d3bdea03 (patch) | |
tree | 3a7944e8c63748e7977534e3bfbf9bb68ae29e8d | |
parent | a1a409a8ca2af0b12ee4b1397ef49e823e89327d (diff) | |
download | node-new-11b6c0de4114fa499bcffbda91d8cea9d3bdea03.tar.gz |
child_process: define EACCES as a runtime error
Access permission on the target child is currently thrown
as an exception. Bring this under the runtime error definition,
much like ENOENT and friends.
PR-URL: https://github.com/nodejs/node/pull/19294
Fixes: https://github.com/nodejs/help/issues/990
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Prince John Wesley <princejohnwesley@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
-rw-r--r-- | lib/internal/child_process.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/internal/child_process.js b/lib/internal/child_process.js index 3c8a314bf0..20ad9754ca 100644 --- a/lib/internal/child_process.js +++ b/lib/internal/child_process.js @@ -33,6 +33,7 @@ const { isUint8Array } = require('internal/util/types'); const spawn_sync = process.binding('spawn_sync'); const { + UV_EACCES, UV_EAGAIN, UV_EINVAL, UV_EMFILE, @@ -315,7 +316,8 @@ ChildProcess.prototype.spawn = function(options) { var err = this._handle.spawn(options); // Run-time errors should emit an error, not throw an exception. - if (err === UV_EAGAIN || + if (err === UV_EACCES || + err === UV_EAGAIN || err === UV_EMFILE || err === UV_ENFILE || err === UV_ENOENT) { |