Fix Error handling for generator

A generator raising an exception will now correctly emit an `error` event.
This can be used in unit test as the error event is now binded between the generator and its run context. 
now checking for the presence fo an error handler, and throwing the exception when there is not (so that we adhere to previous behavior)