diff --git a/lib/datastore.js b/lib/datastore.js index df1bd69..7986d9f 100644 --- a/lib/datastore.js +++ b/lib/datastore.js @@ -546,4 +546,21 @@ Datastore.prototype.remove = function () { }; + +process.on('uncaughtException', function (err) { + console.log(err); +}); + +var ds = new Datastore(); +ds.find({}, function (err) { + process.nextTick(function () { + ds.insert({ bar: 1 }, function (err) { + //We never get here + }); + }); + throw 'foo'; +}); + + + module.exports = Datastore;