diff --git a/.gitignore b/.gitignore index bdf4baa..2485169 100644 --- a/.gitignore +++ b/.gitignore @@ -19,6 +19,7 @@ godot-cpp/gen/ # Editor/OS noise .vscode/ .idea/ +*.code-workspace .DS_Store Thumbs.db diff --git a/.sconsign.dblite b/.sconsign.dblite index 9cd0717..4f4a346 100644 Binary files a/.sconsign.dblite and b/.sconsign.dblite differ diff --git a/demo/test_runtime.gd b/demo/test_runtime.gd index 0637bf5..807f91c 100644 --- a/demo/test_runtime.gd +++ b/demo/test_runtime.gd @@ -136,7 +136,7 @@ func _expect_runtime_error(source: String, expected_error: String) -> bool: if result.ok: push_error("expected runtime error, got success: " + str(result)) return false - if not str(result.error).contains(expected_error) or not str(result.error).contains("[string \"\"]"): + if not str(result.error).contains(expected_error) or not str(result.error).contains("stack traceback"): push_error("unexpected runtime error: " + str(result.error)) return false return true diff --git a/src/onebit_lua_runtime.cpp b/src/onebit_lua_runtime.cpp index 3617670..2be3e05 100644 --- a/src/onebit_lua_runtime.cpp +++ b/src/onebit_lua_runtime.cpp @@ -314,7 +314,7 @@ Dictionary OneBitLuaRuntime::call_event(const String &event_name, const Dictiona int error_handler = function_index; lua_sethook(lua, &OneBitLuaRuntime::_instruction_hook, LUA_MASKCOUNT, int(instruction_budget)); - int status = lua_pcall(lua, 2 + int(args.size()), 0, 0); + int status = lua_pcall(lua, 2 + int(args.size()), 0, error_handler); lua_sethook(lua, nullptr, 0, 0); if (status != LUA_OK) { diff --git a/src/onebit_lua_runtime.os b/src/onebit_lua_runtime.os index 3ae42f1..ffe8141 100644 Binary files a/src/onebit_lua_runtime.os and b/src/onebit_lua_runtime.os differ