From: Tobias Ulmer Date: Fri, 3 May 2013 13:08:30 +0000 (+0200) Subject: Replace abort() in guards of dofile2() with error() X-Git-Tag: e2factory-2.3.15rc1~505 X-Git-Url: https://git.e2factory.org/?a=commitdiff_plain;h=b6905ebcf638d2575d1dccb11ecb66f8645f3a9d;p=e2factory.git Replace abort() in guards of dofile2() with error() Here error() is called in a protected environment. We get an error message back instead of instantly terminating the program. Signed-off-by: Tobias Ulmer --- diff --git a/generic/e2lib.lua b/generic/e2lib.lua index 99e3225..42ba5e9 100644 --- a/generic/e2lib.lua +++ b/generic/e2lib.lua @@ -1192,12 +1192,15 @@ function e2lib.dofile2(path, gtable, allownewdefs) if x then return x else - e2lib.abort(path, ": attempt to reference undefined global variable '", k, "'") + error(string.format( + "%s: attempt to reference undefined global variable '%s'", + path, tostring(k)), 0) end end local function checkwrite(t, k, v) - e2lib.abort(path, ": attempt to set new global variable `", k, "' to ", v) + error(string.format("%s: attempt to set new global variable `%s' to %s", + path, tostring(k), tostring(v)), 0) end if not allownewdefs then