Skip to content

Commit 11b6c0d

Browse files
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: #19294 Fixes: nodejs/help#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>
1 parent a1a409a commit 11b6c0d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/internal/child_process.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ const { isUint8Array } = require('internal/util/types');
3333
const spawn_sync = process.binding('spawn_sync');
3434

3535
const {
36+
UV_EACCES,
3637
UV_EAGAIN,
3738
UV_EINVAL,
3839
UV_EMFILE,
@@ -315,7 +316,8 @@ ChildProcess.prototype.spawn = function(options) {
315316
var err = this._handle.spawn(options);
316317

317318
// Run-time errors should emit an error, not throw an exception.
318-
if (err === UV_EAGAIN ||
319+
if (err === UV_EACCES ||
320+
err === UV_EAGAIN ||
319321
err === UV_EMFILE ||
320322
err === UV_ENFILE ||
321323
err === UV_ENOENT) {

0 commit comments

Comments
 (0)