is it ok to have a yield in one try branch and not another? so it's a generator function in one context and a regular function in another context?