chiark / gitweb /
py/rmcr.py: More useful diagnostics for uncaught exceptions.
authorMark Wooding <mdw@distorted.org.uk>
Sat, 8 May 2010 18:43:18 +0000 (19:43 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Sat, 8 May 2010 18:44:35 +0000 (19:44 +0100)
Well, at least if you turn debugging on.

py/rmcr.py

index 61521b4d66c641863b73c29ddab4e50863c1400d..f73a6cc9ab0a99e91935c5cac234573afd3b6070 100644 (file)
@@ -136,7 +136,9 @@ class Coroutine (object):
                (me, args, kwargs))
         me._func(*args, **kwargs)
       except:
                (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))
     finally:
       _debug('  _start(%s): finally' % me)
       _debug('  _start(%s): _onexit = %s' % (me, me._onexit))