Skip to content

Commit 84818f8

Browse files
committed
Slightly better error message
1 parent 79595dd commit 84818f8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lua/themepark.lua

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,11 @@ function themepark:add_topic(topic, options)
265265
error('Load failed: ' .. msg)
266266
end
267267

268-
local result = func(self, theme, options or {})
268+
local status, result = pcall(func, self, theme, options or {})
269+
if not status then
270+
print("Themepark: Adding topic '" .. topic .. "' from theme '" .. theme_name .. "' failed:")
271+
error(result, 2)
272+
end
269273

270274
if self.debug then
271275
print("Themepark: Adding topic '" .. topic .. "' from theme '" .. theme_name .. "' done.")

0 commit comments

Comments
 (0)