From e110d7aaadd1bea6500c9cfd4c3daa20c3bf2cbc Mon Sep 17 00:00:00 2001 From: Robert McLay Date: Wed, 10 Nov 2021 17:16:46 -0600 Subject: [PATCH] Report bad key with Unknown Error Message --- src/MasterControl.lua | 5 ++++- src/lmod.in.lua | 2 +- src/utils.lua | 2 -- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/MasterControl.lua b/src/MasterControl.lua index 9d5d74755..482116097 100644 --- a/src/MasterControl.lua +++ b/src/MasterControl.lua @@ -727,7 +727,10 @@ local function l_generateMsg(kind, label, ...) if (argA.n == 1 and type(argA[1]) == "table") then local t = argA[1] local key = t.msg - local msg = i18n(key, t) or "Unknown Error Message" + local msg = i18n(key, t) + if (not msg) then + msg = "Unknown Error Message with unknown key: \"".. key .. "\"" + end msg = hook.apply("errWarnMsgHook", kind, key, msg, t) or msg sA[#sA+1] = buildMsg(twidth, label, msg) else diff --git a/src/lmod.in.lua b/src/lmod.in.lua index b93ad781c..51b40be08 100644 --- a/src/lmod.in.lua +++ b/src/lmod.in.lua @@ -376,7 +376,7 @@ function main() dbg.print{"Lmod Version: ",Version.name(),"\n"} dbg.print{"package.path: ",package.path,"\n"} dbg.print{"package.cpath: ",package.cpath,"\n"} - dbg.print{"lmodPath: ", lmodPath,"\n"} + dbg.print{"lmodPath: ", cosmic:value("LMOD_PACKAGE_PATH"),"\n"} end -- dumpversion and quit if requested. diff --git a/src/utils.lua b/src/utils.lua index 37d7b9ad3..11877c314 100644 --- a/src/utils.lua +++ b/src/utils.lua @@ -117,8 +117,6 @@ function initialize_lmod() end require("SitePackage") - - end