Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Fix 'weird error'. #3926

Closed
wants to merge 1 commit into from

3 participants

@thomblake

Whenever npm gets an error code that is numeric, it outputs
'weird error' - including practically every instance of running
'npm test'.

This change outputs 'exit code' for numeric errors and 'weird error'
for the remaining cases.

Related: #3918

@thomblake thomblake Fix 'weird error'.
Whenever npm gets an error code that is numeric, it outputs
'weird error' - including practically every instance of running
'npm test'.

This change outputs 'exit code' for numeric errors and 'weird error'
for the remaining cases.

Related: #3918
d229c90
@thomblake

I couldn't think of a reasonable way to add a test for this - I'm open to suggestions or "it's fine without a test".

@luk-

I like it, I want to get isaac's feedback on it when he's back from vacation though before we throw it in

@thomblake

Will instead modify lifecycle.js to handle numeric errors properly and see how that turns out.

@isaacs
Owner

Fixed on e380dc5. Will be pushed live soon.

@isaacs isaacs closed this
@robertkowalski robertkowalski referenced this pull request
Closed

weird error n #3918

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 23, 2013
  1. @thomblake

    Fix 'weird error'.

    thomblake authored
    Whenever npm gets an error code that is numeric, it outputs
    'weird error' - including practically every instance of running
    'npm test'.
    
    This change outputs 'exit code' for numeric errors and 'weird error'
    for the remaining cases.
    
    Related: #3918
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 0 deletions.
  1. +3 −0  lib/utils/error-handler.js
View
3  lib/utils/error-handler.js
@@ -85,6 +85,9 @@ function errorHandler (er) {
if (typeof er === "string") {
log.error("", er)
return exit(1, true)
+ } else if (typeof er === "number") {
+ log_error("exit code", er)
+ return exit(1, true)
} else if (!(er instanceof Error)) {
log.error("weird error", er)
return exit(1, true)
Something went wrong with that request. Please try again.