fix(config/log): show error in config instead of hiding (#1751)

This commit is contained in:
Chase Colman 2021-10-12 23:33:41 +08:00 committed by GitHub
parent 5deb0e57ce
commit 9e18c16b2b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

@ -152,10 +152,10 @@ end
-- @param config_path The path to the configuration overrides
function M:load(config_path)
config_path = config_path or self.get_user_config_path()
local ok, _ = pcall(dofile, config_path)
local ok, err = pcall(dofile, config_path)
if not ok then
if utils.is_file(user_config_file) then
Log:warn("Invalid configuration: " .. config_path)
Log:warn("Invalid configuration: " .. err)
else
Log:warn(string.format("Unable to find configuration file [%s]", config_path))
end