5 ms·
Avoid JS callback hell with 'yield' (example of a new WebDriver library)
- dmethvin 13y agoWhere'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?
- jlipps 13y agoYou 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()