lupa icon indicating copy to clipboard operation
lupa copied to clipboard

Python exceptions within coroutines are reraised

Open noahcgreen opened this issue 4 years ago • 1 comments

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.

noahcgreen avatar Aug 07 '20 02:08 noahcgreen

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.

synodriver avatar Nov 16 '22 05:11 synodriver