py/rmcr.py: More useful diagnostics for uncaught exceptions.
[tripe] / py / rmcr.py
index 61521b4..f73a6cc 100644 (file)
@@ -136,7 +136,9 @@ class Coroutine (object):
                (me, args, kwargs))
         me._func(*args, **kwargs)
       except:
-        _switchto(findvictim(me.parent), None, exc_info())
+        exc = exc_info()
+        _debug('  _start(%s): caught exception (%s)' % (me, exc))
+        _switchto(findvictim(me.parent), None, exc)
     finally:
       _debug('  _start(%s): finally' % me)
       _debug('  _start(%s): _onexit = %s' % (me, me._onexit))