bluebird: configurable error handling

Is it possible to turn try { ... } catch off in the bluebird promise implementation ?

It would be nice if we could opt out of having the then handler wrapped in a try catch.

This would enable people to make different decisions about error handling opinions instead of going with the “defaults” promises/A+ choose.

About this issue

  • Original URL
  • State: closed
  • Created 11 years ago
  • Comments: 30 (7 by maintainers)

Most upvoted comments

class PromiseThatMissesThePointOfPromises {
  then(onSomething, onSomethingElse) {
    return super(
      value => try {
        return onSomething(value);
      } catch (e) { setImmediate(() => throw e); },
      reason => try {
        return onSomethingElse(reason);
      } catch (e) { setImmediate(() => throw e); }
    );
  }
}