machty / ember-concurrency

ember-concurrency is an Ember Addon that enables you to write concise, worry-free, cancelable, restartable, asynchronous tasks.
http://ember-concurrency.com
MIT License
691 stars 157 forks source link

Error handling in all() appears broken in v2 #400

Closed Turbo87 closed 3 years ago

Turbo87 commented 3 years ago
import { all, task } from 'ember-concurrency';

class extends Component {
  @task(function* () {
    try {
      // this should behave roughly similar to: yield this.task2.perform();
      yield all([this.task2.perform()]);
    } catch (error) {
      console.log("I've caught an error!!1", error);
    }
  })
  task1;

  @task(function* () {
    throw new Error('boom');
  })
  task2;
}

results in:

Bildschirmfoto 2021-02-16 um 09 48 31

In other words, it looks like the all() helper does not handle error properly anymore. With v1 this code worked fine, but with v2 the uncaught error handler is invoked.

/cc @maxfierke

maxfierke commented 3 years ago

Oof. Yeah, that looks like a bug to me! Will take a look tonight.

maxfierke commented 3 years ago

Fixed in v2.0.1

Turbo87 commented 3 years ago

appears to work great. thanks a lot! :)