Skip to content
This repository
Browse code

Fix error messages, handle 301

  • Loading branch information...
commit 28c0bd6f63ac882543bbbdc333897f8efd2863c7 1 parent ad77634
Kris Zyp authored

Showing 1 changed file with 3 additions and 3 deletions. Show diff stats Hide diff stats

  1. +3 3 lib/nodules.js
6 lib/nodules.js
@@ -430,7 +430,7 @@ function makeRequire(currentId){
430 430 moduleExports[id] || defaultRequire(id);
431 431 }catch(e){
432 432 factories[uri] = function(){
433   - throw new Error(error.message + " failed to load " + uri);
  433 + throw new Error(error.stack + " failed to load " + uri);
434 434 };
435 435 }
436 436 decrementWaiting();
@@ -754,7 +754,7 @@ function getUri(uri, tries){
754 754 }
755 755 print("Downloading " + uri + (tries > 1 ? " attempt #" + tries : ""));
756 756 return requestedUris[uri] = request({url:uri, encoding:"binary"}).then(function(response){
757   - if(response.status == 302){
  757 + if(response.status == 302 || response.status == 301){
758 758 return getUri(response.headers.location);
759 759 }
760 760 if(response.status < 300){
@@ -772,7 +772,7 @@ function getUri(uri, tries){
772 772 if(response.status == 404){
773 773 return null;
774 774 }
775   - throw new Error(response.status + response.body);
  775 + throw new Error(response.status);
776 776 }, function(error){
777 777 tries++;
778 778 if(tries > 3){

0 comments on commit 28c0bd6

Please sign in to comment.
Something went wrong with that request. Please try again.