memcache-plus
Advanced tools
Comparing version 0.0.7 to 0.0.8
@@ -270,10 +270,3 @@ /** | ||
return Promise.all(R.map(function(key) { | ||
return self.run('get', [key], cb).catch(function(err) { | ||
if (err.type === 'NotFoundError') { | ||
// In getMulti, rather than throwing an error if an item is not | ||
// found, we set to null. Don't want the whole set to fail if | ||
// one item doesn't exist | ||
return null; | ||
} | ||
}); | ||
return self.run('get', [key], cb); | ||
}, keys)); | ||
@@ -280,0 +273,0 @@ }; |
@@ -253,3 +253,3 @@ /** | ||
} else { | ||
throw new misc.NotFoundError('No data found for key ' + key); | ||
return null; | ||
} | ||
@@ -256,0 +256,0 @@ }); |
@@ -24,11 +24,1 @@ /** | ||
}; | ||
var NotFoundError = function(message) { | ||
this.type = 'NotFoundError'; | ||
this.message = message; | ||
this.stack = (new Error()).stack; | ||
}; | ||
NotFoundError.prototype = Object.create(Error.prototype); | ||
exports.NotFoundError = NotFoundError; |
{ | ||
"name": "memcache-plus", | ||
"version": "0.0.7", | ||
"version": "0.0.8", | ||
"description": "Better memcache for node", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -157,8 +157,4 @@ require('chai').should(); | ||
return cache.get(chance.word()) | ||
.catch(function(err) { | ||
// Since we catch this error here, it won't bubble up the stack | ||
// which is what we want, else it'd report this test as a failure. | ||
// Note, under other circumstances, this would be a Promise anti-pattern. | ||
err.should.be.ok; | ||
err.type.should.equal('NotFoundError'); | ||
.then(function(v) { | ||
expect(v).to.be.null; | ||
}); | ||
@@ -168,6 +164,5 @@ }); | ||
it('with Callback', function(done) { | ||
cache.get(chance.word(), function(err) { | ||
err.should.be.ok; | ||
err.type.should.equal('NotFoundError'); | ||
done(); | ||
cache.get(chance.word(), function(err, response) { | ||
expect(response).to.be.null; | ||
done(err); | ||
}); | ||
@@ -252,4 +247,4 @@ }); | ||
}) | ||
.catch(function(err) { | ||
err.type.should.equal('NotFoundError'); | ||
.then(function(v) { | ||
expect(v).to.be.null; | ||
}); | ||
@@ -281,10 +276,8 @@ }); | ||
}) | ||
.catch(function(err) { | ||
err.type.should.equal('NotFoundError'); | ||
}) | ||
.then(function() { | ||
.then(function(v) { | ||
expect(v).to.be.null; | ||
return cache.get(key2); | ||
}) | ||
.catch(function(err) { | ||
err.type.should.equal('NotFoundError'); | ||
.then(function(v) { | ||
expect(v).to.be.null; | ||
}); | ||
@@ -291,0 +284,0 @@ }); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
36529
896