MCPcopy Index your code
hub / github.com/nodejs/node / #logConsoleError

Method #logConsoleError

deps/npm/lib/cli/exit-handler.js:116–124  ·  view source on GitHub ↗
(err)

Source from the content-addressed store, hash-verified

114 }
115
116 #logConsoleError (err) {
117 // Run our error message formatters on all errors even if we have no npm or an unloaded npm.
118 // This will clean the error and possible return a formatted message about EACCESS or something.
119 const { summary, detail } = errorMessage(err, this.#npm)
120 const formatted = [...new Set([...summary, ...detail].flat().filter(Boolean))].join('\n')
121 // If we didn't get anything from the formatted message then just display the full stack
122 // eslint-disable-next-line no-console
123 console.error(formatted === err.message ? err.stack : formatted)
124 }
125
126 #logNoNpmError (err) {
127 if (this.#hasNpm) {

Callers 3

#handleProcessExitMethod · 0.95
#logNoNpmErrorMethod · 0.95
ExitHandlerClass · 0.95

Calls 4

filterMethod · 0.65
errorMessageFunction · 0.50
joinMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected