Hacker News new | ask | show | jobs
by dmethvin 4708 days ago
Where's the error handling?

The `yield` calls are definitely simplifying the no-errors case, but it looks like any of those yields can throw an error back to the enclosing function. All the errors from all the yields end up in the same function? If you care about some or all of them and want to tell where the problem occurred, you'd need to wrap each `yield` in a try/catch?

1 comments

You could wrap the whole thing in a try-catch and catch the first error to occur.

In my experience, running this with Mocha, errors are handled automatically by it()