Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

add err.command on exec() failures #6796

Closed
tj opened this issue Jan 3, 2014 · 6 comments
Closed

add err.command on exec() failures #6796

tj opened this issue Jan 3, 2014 · 6 comments

Comments

@tj
Copy link

tj commented Jan 3, 2014

sometimes you get these gems "Command failed:", would be nice to not have to manually augment the error

@trevnorris
Copy link

Can you provide an example?

@tj
Copy link
Author

tj commented Jan 4, 2014

contrived example but for stuff like this it may be nice to see if there's no stderr and then use the command as the message, or since that's sort of awkward it would at least be nice to have err.command so there's something to go on

var exec = require('child_process').exec;

exec('cat /foo 2> /dev/null', function(err){
  throw err;
});
  throw err;
        ^
Error: Command failed: 
    at ChildProcess.exithandler (child_process.js:661:12)
    at ChildProcess.EventEmitter.emit (events.js:101:17)
    at maybeClose (child_process.js:773:16)
    at Socket.<anonymous> (child_process.js:993:11)
    at Socket.EventEmitter.emit (events.js:98:17)
    at Pipe.close (net.js:459:12)

indutny added a commit to indutny/node that referenced this issue Jan 4, 2014
Report path to executable and argv on error, stderr is not enough in
many cases.

fix nodejs#6796
@indutny
Copy link
Member

indutny commented Jan 4, 2014

See ^

@tj
Copy link
Author

tj commented Jan 5, 2014

awesome! thanks man

@tj tj closed this as completed Jan 5, 2014
@tj
Copy link
Author

tj commented Jan 5, 2014

oh sorry thought that was master haha

@tj tj reopened this Jan 5, 2014
@indutny
Copy link
Member

indutny commented Jan 5, 2014

Well, I don't think that we can land it in v0.10.

@indutny indutny closed this as completed in 730e511 Jan 8, 2014
richardlau pushed a commit to ibmruntimes/node that referenced this issue May 17, 2016
- **buffer**: fix lastIndexOf and indexOf in various edge cases (Anna
  Henningsen) [nodejs#6511](nodejs/node#6511)
- **child_process**: use /system/bin/sh on android (Ben Noordhuis)
  [nodejs#6745](nodejs/node#6745)
- **deps**:
  - upgrade npm to 3.8.9 (Rebecca Turner)
    [nodejs#6664](nodejs/node#6664)
  - upgrade to V8 5.0.71.47 (Ali Ijaz Sheikh)
    [nodejs#6572](nodejs/node#6572)
  - upgrade libuv to 1.9.1 (Saúl Ibarra Corretgé)
    [nodejs#6796](nodejs/node#6796)
  - Intl: ICU 57 bump (Steven R. Loomis)
    [nodejs#6088](nodejs/node#6088)
- **repl**:
  - copying tabs shouldn't trigger completion (Eugene Obrezkov)
    [nodejs#5958](nodejs/node#5958)
  - exports `Recoverable` (Blake Embrey)
    [nodejs#3488](nodejs/node#3488)
- **src**: add O_NOATIME constant (Rich Trott)
  [nodejs#6492](nodejs/node#6492)
- **src,module**: add --preserve-symlinks command line flag (James M
  Snell) [nodejs#6537](nodejs/node#6537)
- **util**: adhere to `noDeprecation` set at runtime (Anna Henningsen)
  [nodejs#6683](nodejs/node#6683)
richardlau pushed a commit to ibmruntimes/node that referenced this issue May 18, 2016
- **buffer**: fix lastIndexOf and indexOf in various edge cases (Anna
  Henningsen) [nodejs#6511](nodejs/node#6511)
- **child_process**: use /system/bin/sh on android (Ben Noordhuis)
  [nodejs#6745](nodejs/node#6745)
- **deps**:
  - upgrade npm to 3.8.9 (Rebecca Turner)
    [nodejs#6664](nodejs/node#6664)
  - upgrade to V8 5.0.71.47 (Ali Ijaz Sheikh)
    [nodejs#6572](nodejs/node#6572)
  - upgrade libuv to 1.9.1 (Saúl Ibarra Corretgé)
    [nodejs#6796](nodejs/node#6796)
  - Intl: ICU 57 bump (Steven R. Loomis)
    [nodejs#6088](nodejs/node#6088)
- **repl**:
  - copying tabs shouldn't trigger completion (Eugene Obrezkov)
    [nodejs#5958](nodejs/node#5958)
  - exports `Recoverable` (Blake Embrey)
    [nodejs#3488](nodejs/node#3488)
- **src**: add O_NOATIME constant (Rich Trott)
  [nodejs#6492](nodejs/node#6492)
- **src,module**: add --preserve-symlinks command line flag (James M
  Snell) [nodejs#6537](nodejs/node#6537)
- **util**: adhere to `noDeprecation` set at runtime (Anna Henningsen)
  [nodejs#6683](nodejs/node#6683)

As of this release the 6.X line now includes 64-bit binaries for Linux
on Power Systems running in big endian mode in addition to the existing
64-bit binaries for running in little endian mode.

PR-URL: nodejs/node#6810
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants