mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 23:49:33 +00:00
Adds trace info upon failing 'plugins_metadata' require
Addresses #4492
This commit is contained in:
parent
c43ec95ea5
commit
c795fdb4e9
1 changed files with 10 additions and 1 deletions
|
|
@ -765,7 +765,16 @@ local function load_metadata()
|
|||
if not METADATA then
|
||||
local runtime_path = plugins_utils.getRuntimePath()
|
||||
lua_path_utils.package_path_prepend(runtime_path)
|
||||
METADATA = require(PLUGIN_RELATIVE_PATHS.metadata)
|
||||
|
||||
-- Do the require via pcall to avoid Lua generating an exception.
|
||||
-- Print an error and a stacktrace when the require fails.
|
||||
local status
|
||||
status, METADATA = pcall(require, PLUGIN_RELATIVE_PATHS.metadata)
|
||||
|
||||
if not status then
|
||||
traceError(TRACE_ERROR, TRACE_CONSOLE, string.format("Could not load plugins metadata file '%s'", PLUGIN_RELATIVE_PATHS.metadata))
|
||||
tprint(debug.traceback())
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue