Thanks Calvin - you're quite right, return missing there and a few other 
places. I have added the returns and I'll add tests for the error 
handling when I have time.
On 1/02/2014 5:50 a.m., Calvin Metcalf wrote:
>
> In lib/replicate.js:
>
> >      }
> > -    var len = writeQueue.length;
> > -    target.bulkDocs({docs: writeQueue}, {new_edits: false}, function (err, res) {
> > -      docsWritten(err, res, len);
> > -    });
> > -    writeQueue = [];
> > +
> > +    if (err) {
> > +      abortReplication(err);
>
> this should return (i.e. |return abortReplication(err);|) as we don't 
> want to execute the rest of this function (I believe) it's causing 
> error messages in node.
>
> —
> Reply to this email directly or view it on GitHub 
> <https://github.com/daleharvey/pouchdb/pull/1268/files#r9348431>.
>