getify / CAF

Cancelable Async Flows (CAF)
MIT License
1.34k stars 46 forks source link

Only catch canceled promise #1

Closed fabiancook closed 6 years ago

fabiancook commented 6 years ago

On this line:

https://github.com/getify/caf/blob/de36fed170aa4e733c2418eaeaaa6bd2f9ca8259/src/caf.src.js#L31

Would it not be beneficial to be able to pick up on the pr errors externally? By catching everything from race would that mean the promise is always going to resolve?

getify commented 6 years ago

That line doesn't prevent you from listening, it only also listens, to prevent the annoying "unhandled rejection" warnings (in node) if you fail to listen to the rejection.

You can of course (and should!) listen for both resolution and rejection.

getify commented 6 years ago

Closing for now. Re-open if you have any further concerns.