padolsey / operative

:dog2: Seamlessly create Web Workers
MIT License
656 stars 45 forks source link

Try/catch within a function seems to break operative? #42

Closed alan-unravel closed 8 years ago

alan-unravel commented 8 years ago

Not sure why this would be the case can anyone shine some light on this? Thanks in advance.

padolsey commented 8 years ago

Throwing/Trying/Catching seems to work intuitively within an operative, see: http://jsbin.com/yayayanuho/edit?html,js,output

Could you paste an example of it breaking?

alan-unravel commented 8 years ago

Sure apologies if this is some silly mistake

 "dimension.group.reduceSum": function(index, accessor) {
    var promise = this.deferred();
    try
    {
      this.dimensionGroups[index].reduceSum(this.unpack(accessor));
      promise.fulfill();
    } catch (e){
      promise.reject();
    }
}
alan-unravel commented 8 years ago

Hey guys sorry, it was a mistake on my part compounded together with a different issue. Thanks! Great library btw