Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.

Fixes: nodejs/help#990
  • Loading branch information
gireeshpunathil committed Mar 12, 2018
commit 07b7b2ea480a9c405bd8841ed02c429a0a96ea16
4 changes: 3 additions & 1 deletion lib/internal/child_process.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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) {
Expand Down