Skip to content

Commit

Permalink
Cleanup stack printing
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed Jul 24, 2012
1 parent cf4f225 commit 7bb6f33
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/utils/error-handler.js
Expand Up @@ -69,6 +69,7 @@ function exit (code, noLog) {


function errorHandler (er) {
var printStack = false
// console.error("errorHandler", er)
if (!ini.resolved) {
// logging won't work unless we pretend that it's ready
Expand All @@ -93,7 +94,6 @@ function errorHandler (er) {
var m = er.code || er.message.match(/^(?:Error: )?(E[A-Z]+)/)
if (m && !er.code) er.code = m

var printStack = false
switch (er.code) {
case "ECONNREFUSED":
log.error("", er)
Expand Down Expand Up @@ -217,6 +217,7 @@ function errorHandler (er) {
,"or email it to:"
," <npm-@googlegroups.com>"
].join("\n"))
printStack = false
break
}

Expand All @@ -230,9 +231,6 @@ function errorHandler (er) {
log.error("node -v", process.version)
log.error("npm -v", npm.version)

// if we're not going to print it below, still save it to the log
if (!printStack) log.silly("stack", er.stack || er.message)

; [ "file"
, "path"
, "type"
Expand Down

0 comments on commit 7bb6f33

Please sign in to comment.