MCPcopy Index your code
hub / github.com/nodejs/node / getExitCodeFromError

Function getExitCodeFromError

deps/npm/lib/utils/error-message.js:374–380  ·  view source on GitHub ↗
(err)

Source from the content-addressed store, hash-verified

372}
373
374const getExitCodeFromError = (err) => {
375 if (typeof err?.errno === 'number') {
376 return err.errno
377 } else if (typeof err?.code === 'number') {
378 return err.code
379 }
380}
381
382const getError = (err, { npm, command, pkg }) => {
383 // if we got a command that just shells out to something else, then it will presumably print its own errors and exit with a proper status code if there's a problem.

Callers 2

getErrorFunction · 0.85
ExitHandlerClass · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…