Software / code / prosody
Diff
util/pluginloader.lua @ 13831:bf4cd327966f
Merge 13.0->trunk
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Wed, 09 Apr 2025 10:59:28 +0100 |
| parent | 13829:dde0ce03049b |
line wrap: on
line diff
--- a/util/pluginloader.lua Thu Apr 03 20:37:03 2025 +0100 +++ b/util/pluginloader.lua Wed Apr 09 10:59:28 2025 +0100 @@ -25,6 +25,7 @@ function pluginloader_methods:load_file(names) local file, err, path; local load_filter_cb = self._options.load_filter_cb; + local last_filter_path, last_filter_err; for i=1,#plugin_dir do for j=1,#names do path = plugin_dir[i]..names[j]; @@ -36,12 +37,18 @@ if load_filter_cb then path, content, metadata = load_filter_cb(path, content); end - if content and path then + if path and content then return content, path, metadata; + else + last_filter_path = plugin_dir[i]..names[j]; + last_filter_err = content or "skipped"; end end end end + if last_filter_err then + return nil, err..(" (%s skipped because of %s)"):format(last_filter_path, last_filter_err); + end return file, err; end