lupa
lupa copied to clipboard
Python exceptions within coroutines are reraised
Fixes #144. Currently if a lua coroutine calls Python code which raises an exception, a LuaError will be raised and the original exception will be lost. This isn't consistent with the behavior of non-coroutine code, which is to reraise the exception, and losing the original exception makes it very hard to debug lua coroutines.
A new unit test test_coroutine_reraises_python_error
has been added.
I've also meet the same problem, and I think the extra check should be at resume_lua_thread
, right before raise_lua_error(thread._runtime, co, status)
, which only influence co.send
itself.