# HG changeset patch # User Matthew Wild # Date 1552986315 0 # Node ID 984f27e4b8a3406e997e7631ce90f5052b854140 # Parent 09cc8c856e5eb062e84ead0a855384540f1154d9 modulemanager: Set module status on successful or failed module load diff -r 09cc8c856e5e -r 984f27e4b8a3 core/modulemanager.lua --- a/core/modulemanager.lua Tue Mar 19 09:04:40 2019 +0000 +++ b/core/modulemanager.lua Tue Mar 19 09:05:15 2019 +0000 @@ -169,6 +169,7 @@ local mod, err = pluginloader.load_code(module_name, nil, pluginenv); if not mod then log("error", "Unable to load module '%s': %s", module_name or "nil", err or "nil"); + api_instance:set_status("error", "Failed to load (see log)"); return nil, err; end @@ -182,6 +183,7 @@ ok, err = call_module_method(pluginenv, "load"); if not ok then log("warn", "Error loading module '%s' on '%s': %s", module_name, host, err or "nil"); + api_instance:set_status("warn", "Error during load (see log)"); end end api_instance.reloading, api_instance.saved_state = nil, nil; @@ -204,6 +206,9 @@ if not ok then modulemap[api_instance.host][module_name] = nil; log("error", "Error initializing module '%s' on '%s': %s", module_name, host, err or "nil"); + api_instance:set_status("warn", "Error during load (see log)"); + else + api_instance:set_status("core", "Loaded", false); end return ok and pluginenv, err; end