better error message for proxy users, fixes #3415 #3426

Closed
wants to merge 1 commit into
from

Projects

None yet

3 participants

@robertkowalski
Member

This fixes #3415 (proxy users are getting errors that they can't interpret) which currently results in an increased need for support.

Here is a preview of the message:

(01:22:20) [robert@tequila-apple] ~/npm (master *) $ npm install foo2
npm http GET http://registry.npmjs.org/foo2
npm http GET http://registry.npmjs.org/foo2
npm http GET http://registry.npmjs.org/foo2
npm ERR! network getaddrinfo ENOTFOUND
npm ERR! network This is most likely not a problem with npm itself
npm ERR! network and is related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly.  See: 'npm help config'

npm ERR! System Darwin 12.3.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "foo2"
npm ERR! cwd /Users/robert/npm
npm ERR! node -v v0.10.4
npm ERR! npm -v 1.2.19
npm ERR! syscall getaddrinfo
npm ERR! code NETWORK
npm ERR! errno ENOTFOUND
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     /Users/robert/npm/npm-debug.log
npm ERR! not ok code 0
@domenic domenic and 1 other commented on an outdated diff May 9, 2013
lib/utils/error-handler.js
@@ -215,6 +215,17 @@ function errorHandler (er) {
log.error("peerinvalid", [er.message].concat(peerErrors).join("\n"))
break
+ case "ENOTFOUND":
+ er.code = "NETWORK"
@domenic
domenic May 9, 2013 npm member

What is this for?

@robertkowalski
robertkowalski May 9, 2013 npm member

Removed it as it currently has no usage. Initial thought was that every error message is defining one.

@domenic
Member
domenic commented May 9, 2013

In that case I'll merge this tonight :).

@domenic
Member
domenic commented May 10, 2013

Awesome, thanks so much! Merged as 0499e71.

@domenic domenic closed this May 10, 2013
@luk-
luk- commented May 20, 2013

nice!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment