From 892b3a5272127bdfa4ecead176d2bca1dd11fdad Mon Sep 17 00:00:00 2001 From: Kyle Evans Date: Mon, 26 Mar 2018 19:06:25 +0000 Subject: [PATCH] lualoader: Actually re-raise error in try_include It was previously only printed, but we do actually want to raise it as a full blown error so that things don't look OK when they've actually gone wrong. The second parameter to error, level, is set to 2 here so that the error message reflects the position of the try_include caller, rather than the try_include itself. Example: LUA ERROR: /boot/lua/loader.lua:46: /boot/lua/local.lua:1: attempt to call a nil value (global 'cxcint'). --- stand/lua/core.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stand/lua/core.lua b/stand/lua/core.lua index 6980d798c29..8a821206c18 100644 --- a/stand/lua/core.lua +++ b/stand/lua/core.lua @@ -56,7 +56,7 @@ function try_include(module) -- configuration will not display 'module not found'. All other errors -- in loading will be printed. if config.verbose or ret:match("^module .+ not found") == nil then - print(ret) + error(ret, 2) end return nil end