Closed vitaly-t closed 1 year ago
The fix was implemented in v3.0.5, which makes the following possible:
const i = pipeAsync([1, 2, 3], delay(10), timeout(1, () => {
throw new Error('timeout');
}))
.catch(err => {
console.log(err); //=> Error: "timeout"
});
i.e. if you throw an error inside timeout callback, it previously would not be handled correctly, but now it is.
Currently, if you throw an error while handling callback of operator timeout, it is not handled. It should be caught and passed on down the chain.
Why it matters: you may want to handle a callback, and turn it into an error that will be handled in a generic way, via catchError.
It can be considered both a bug (more likely) and an enhancement.
NOTE: This issue primarily affects the async version of the operator.