Commit f85e4755 authored by Carla Goncalves Ourofino's avatar Carla Goncalves Ourofino
Browse files

Melhoria de implementação e organização das mensagens.

[SOMA-3827][SOMA-4161]
parent 48894683
......@@ -59,8 +59,7 @@ local function get_from_multiple(filename, sga_name, config)
local config_data = sgas[sga_name]
if not config_data then
warning = warning ~= "" and warning..'\n' or ""
return nil, warning..string.format(err, filename, "'"..sga_name.."' not found")
return nil, warning..'\n'..string.format(err, filename, "'"..sga_name.."' not found")
end
return config_data, warning
end
......@@ -128,14 +127,14 @@ function configuration.check(config, just_warn)
}
local err = schema.CheckSchema(config, config_schema)
if err then
local prefix = ""
err = " Configuration error: \n"..tostring(err).."\n"
if config.sga_name then
prefix = "["..config.sga_name.."] "
err = "["..config.sga_name.."]"..err
end
if just_warn then
io.stderr:write("[WARNING] "..prefix.."Configuration error: \n"..tostring(err).."\n")
io.stderr:write("[WARNING]"..err)
else
io.stderr:write(prefix.."Configuration error: \n"..tostring(err).."\n")
io.stderr:write(err)
os.exit(1)
end
end
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment