Skip to content
Snippets Groups Projects
Unverified Commit 097efa9d authored by Matthias Schiffer's avatar Matthias Schiffer
Browse files

scripts: feature_lib.lua: improve error handling for invalid feature files

Print a proper error message, rather than just

    openwrt/staging_dir/hostpkg/bin/lua: scripts/feature_lib.lua:48: bad
    argument #1 to 'setfenv' (integer expected, got nil)
parent b1294472
No related branches found
No related tags found
No related merge requests found
...@@ -43,7 +43,10 @@ function M.get_packages(file, features) ...@@ -43,7 +43,10 @@ function M.get_packages(file, features)
end end
-- Evaluate the feature definition file -- Evaluate the feature definition file
local f = loadfile(file) local f, err = loadfile(file)
if not f then
error('Failed to parse feature definition: ' .. err)
end
setfenv(f, funcs) setfenv(f, funcs)
f() f()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment