Checks if an exception happened when yielding