Skip to content

Commit dfdc85e

Browse files
committed
fix(plugin): proper error message when a plugin spec returns more than one value.
1 parent 202d8e9 commit dfdc85e

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

lua/lazy/core/plugin.lua

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,11 @@ function Spec:import(spec)
156156
load = function()
157157
local mod, err = loadfile(modpath)
158158
if mod then
159-
return mod()
159+
local ret, foo = mod()
160+
if foo then
161+
return nil, "Spec module returned more than one value. Expected a single value."
162+
end
163+
return ret
160164
else
161165
return nil, err
162166
end

0 commit comments

Comments
 (0)