async-stream icon indicating copy to clipboard operation
async-stream copied to clipboard

use `yield new Error()` instead of `throw new Error()`

Open Raynos opened this issue 11 years ago • 1 comments

the former allows you to pass errors to generator runner without going throw the exception system.

This works cleanly with raynos/gens and Agen spec

Raynos avatar Feb 04 '14 23:02 Raynos

yield new Error() doesn't work with co, I don't see the advantage over throwing though

juliangruber avatar Feb 09 '14 09:02 juliangruber