What is wrong
If you are developing with Unity 3D, coroutines are part of your life. Exceptions are also. It sounds trivial, but it is not easy to bring together both of these things.
One of the natural ways to handle general exception is to surround it with try..catch:
Looks nice, right?
No, it doesn’t. It won’t even compile. We need to get rid of yield from block to get it to work:
Shit, not what I looked for…
In order to handle this strange case I have created a wrapper
Usage is very simple: