Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

change error handling to treat non-404s as fatals

  • Loading branch information...
commit 46132d5bc28b99c5a0acc9fbf4b98c4c8d58a958 1 parent 78f68fa
@tj tj authored
Showing with 1 addition and 2 deletions.
  1. +1 −1  lib/Package.js
  2. +0 −1  test/remotes.js
View
2  lib/Package.js
@@ -325,7 +325,7 @@ Package.prototype.reallyInstall = function(){
batch = new Batch;
self.getJSON(function(err, json){
if (err) {
- err.fatal = last;
+ err.fatal = 404 != err.status || last;
return self.emit('error', err);
}
View
1  test/remotes.js
@@ -124,7 +124,6 @@ describe('component install from remote', function(){
it('should fail when credentials are incorrect', function(done){
exec('bin/component install private-registry/testcomponent', function(err, stdout, stderr){
- if (err) return done(err);
stderr.should.include('error');
stderr.should.include('failed to fetch http://admin:abcd@localhost:4001/private-registry/testcomponent/master/component.json');
stderr.should.include('got 401 "Unauthorized"');
Please sign in to comment.
Something went wrong with that request. Please try again.