Permalink
Browse files

change error handling to treat non-404s as fatals

  • Loading branch information...
1 parent 78f68fa commit 46132d5bc28b99c5a0acc9fbf4b98c4c8d58a958 @tj tj committed Mar 26, 2013
Showing with 1 addition and 2 deletions.
  1. +1 −1 lib/Package.js
  2. +0 −1 test/remotes.js
View
@@ -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
@@ -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"');

0 comments on commit 46132d5

Please sign in to comment.