Skip to content

.errno field of errors from child_process.execSync is in string form instead of numeric. #12819

Description

@daurnimator
  • Version: v7.9.0
  • Platform: Linux daurn-m73 4.10.11-1-ARCH #1 SMP PREEMPT Tue Apr 18 08:39:42 CEST 2017 x86_64 GNU/Linux
  • Subsystem: child_process

The .errno field of errors from child_process.execSync is in string form instead of numeric.

$ node -e 'try{require("child_process").execSync("foo", {shell: "doesnt_exit"})}catch(e){console.log(e.errno)}'
ENOENT

In this example I expect the numeric value -2 (as it is (correctly) is for other operations such as open:
try{require("fs").openSync("doesnt_exist", "r")}catch(e){console.log(e.errno)}).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    child_processIssues and PRs related to the child_process subsystem.errorsIssues and PRs related to JavaScript errors originating in Node.js core.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions