Permalink
Browse files

fixed recovery for request errors, and improved error logging

  • Loading branch information...
1 parent e0889e7 commit 7f2573a717e44d9e89414107943c70789531b066 @icodeforlove committed Feb 2, 2013
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/requester.js
View
@@ -234,13 +234,13 @@ Requester.prototype = {
);
this._requestObject.setTimeout(this._timeout, function () {
- self._requestObject.destroy();
- self._requestObject = null;
+ if (self._debug > 0) console.log('FAILED '.red + self._method.grey + ' ' + url.format(self._url) + (' (' + 'timeout' + ')').red);
self._requestFailed(null);
});
this._requestObject.on('error', function(e) {
- console.log('problem with request: ' + e.message);
+ if (self._debug > 0) console.log('FAILED '.red + self._method.grey + ' ' + url.format(self._url) + (' (' + e.message + ')').red);
+ self._requestFailed(null);
});
},
@@ -377,4 +377,4 @@ Requester.prototype = {
}
};
-module.exports = exports = RequesterHandler;
+module.exports = exports = RequesterHandler;

0 comments on commit 7f2573a

Please sign in to comment.