Skip to content
Myr

reimplement errname lookup. (#38)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by James Talmage · committed by Sindre Sorhus · parent 6288806 · Browse files · 3 files+74 added−4 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

3 files+74 added−4 removed

  • tests:+33 added−0 removed
  • other:+41 added−4 removed

3 files+74 added−4 removed

added:lib/errname.js+39 added
added:test/errname.js+33 added
modified:index.js+2 added-4 removed
6 unmodified lines
7var npmRunPath = require('npm-run-path');8var isStream = require('is-stream');9var _getStream = require('get-stream');10var pathKey = require('path-key')();11var errname = require('./lib/errname');12var TEN_MEBIBYTE = 1024 * 1024 * 10;1314function handleArgs(cmd, args, opts) {15 var parsed;
143 unmodified lines
159 // https://github.com/nodejs/node/blob/master/lib/child_process.js#L203160 // err.killed = spawned.killed || killed;161 err.killed = spawned.killed;162162 // TODO: child_process applies the following logic for resolving the code:163 // var uv = process.bind('uv');164 // ex.code = code < 0 ? uv.errname(code) : code;165 err.code = code;163 err.code = code < 0 ? errname(code) : code;164 }165166 err.stdout = stdout;167 err.stderr = stderr;
57 unmodified lines