fix a bug in a generator test
throw an error when there is a try block inside generator