Pass catched exceptions, fix error in addMessage

master
Vitaliy Filippov 2016-07-25 16:13:23 +03:00
parent fda15026d6
commit 4b52453e47
1 changed files with 3 additions and 2 deletions

View File

@ -148,7 +148,7 @@ Syncer.runFetch = function*(what, params, boxId, processor)
var cb, wait;
f.on('message', function(msg, seqnum)
{
gen.run(self.onMessage(msg, seqnum, boxId, processor), checkFinish, checkFinish);
gen.run(self.onMessage(msg, seqnum, boxId, processor), checkFinish, function(e) { checkFinish(); throw e; });
});
cb = gen.cb();
@ -158,7 +158,7 @@ Syncer.runFetch = function*(what, params, boxId, processor)
if (self.parsed <= 0)
cb();
else if (self.pending.length > 0)
gen.run(self[processor](self.pending, boxId), saveLast, saveLast);
gen.run(self[processor](self.pending, boxId), saveLast, function(e) { saveLast(); throw e; });
});
function saveLast()
@ -280,6 +280,7 @@ Syncer.saveMessages = function*(messages, boxId)
Syncer.addMessage = function*(msgrow, attrs)
{
var self = this;
var pgtx, end_transaction;
try
{