lua: fix loader behaviour in case of syntax error
The patch fixes error handling between module "searching" and "loading" processes. Originally, if a module is not found, the error message is returned to <require> and is appended to the "not found" message. If no suitable module is found, the error is raised by <require>. In case, when the desired module is found, <require> tries to load it. If any error occurs while loading the module, the "loader" yields the corresponding error. The latter part was broken since the commit 5be3a82b ("lua: fix loaders behavior"), so if the error occurs while loading the module, Tarantool proceeds with searching the module in other locations. This bug was found via the lua-Harness suite[1] used in the tarantool/luajit testing routine, so the test added in the patch partially duplicates the particular test case in lua-Harness. [1]: https://fperrad.frama.io/lua-Harness/ Needed for tarantool/tarantool-ee#585 NO_DOC=bugfix
Showing
- changelogs/unreleased/fix-lua-loader-error-handling.md 4 additions, 0 deletionschangelogs/unreleased/fix-lua-loader-error-handling.md
- src/lua/loaders.lua 3 additions, 5 deletionssrc/lua/loaders.lua
- test/app-luatest/fix_lua_loader_error_handling_test.lua 44 additions, 0 deletionstest/app-luatest/fix_lua_loader_error_handling_test.lua
Loading
Please register or sign in to comment