Adding exception recovery to generators