Yes but it still deoptomize the whole function and uses console.log instead
of a real error event
On Mar 21, 2014 11:08 AM, "Nolan Lawson" <notifications@github.com> wrote:

> In taskqueue.js:
>
> > +
> > +TaskQueue.prototype.execute = function () {
> > +  var self = this;
> > +
> > +  if (self.isReady && self.queue.length) {
> > +    var task = self.queue.shift();
> > +    var oldCB = task.parameters[task.parameters.length - 1];
> > +    task.parameters[task.parameters.length - 1] = function (err, res) {
> > +      oldCB.call(this, err, res);
> > +      self.isReady = true;
> > +      self.execute();
> > +    };
> > +    self.isReady = false;
> > +    try {
> > +      self.registeredTasks[task.name].apply(null, task.parameters);
> > +    } catch (err) {
>
> This one is fine; it will never throw given the current usage. That's just
> to ensure that the taskQueue doesn't get stuck and fail to execute the next
> task if the previous task throws.
>
> --
> Reply to this email directly or view it on GitHub<https://github.com/pouchdb/mapreduce/pull/68/files#r10839158>
> .
>