add some debug messages

This commit is contained in:
Matias Alejo Garcia 2014-11-11 09:01:31 -03:00
commit e0969cd95c

View file

@ -47,7 +47,7 @@ InsightStorage.prototype.getItem = function(name, callback) {
var self = this;
this._makeGetRequest(passphrase, name, function(err, body) {
console.log('[InsightStorage.js.49:err:]',err); //TODO
if (err) log.info('[InsightStorage. err]', err);
if (err && err.indexOf('PNOTFOUND') !== -1 && mayBeOldPassword(self.password)) {
return self._brokenGetItem(name, callback);
}
@ -77,15 +77,16 @@ InsightStorage.prototype.getPassphrase = function() {
InsightStorage.prototype._makeGetRequest = function(passphrase, key, callback) {
var authHeader = new buffers.Buffer(this.email + ':' + passphrase).toString('base64');
var retrieveUrl = this.storeUrl + '/retrieve';
log.debug(retrieveUrl);
this.request.get({
var getParams = {
url: retrieveUrl + '?' + querystring.encode({
key: key
}),
headers: {
'Authorization': authHeader
}
},
};
log.debug('Insight request', getParams);
this.request.get(getParams,
function(err, response, body) {
if (err) {
return callback('Connection error');