Commit fa09978a authored by Gabriel Manhães's avatar Gabriel Manhães
Browse files

Tratando erro pra sga_name já definido no arquivo de configuração [SOMA-3827][SOMA-4074]

Showing with 4 additions and 8 deletions
+4 -8
......@@ -26,24 +26,20 @@ local function get_from_multiple(filename, sga_name, config)
if not sga_name then
return nil, string.format(err, filename, "missing sga_name argument")
end
if config.sga_name then
-- TODO: Dar erro se config default tiver sga_name
config.sga_name = nil
end
local config_data = config.sga[sga_name]
if not config_data then
return nil, string.format(err, filename, "'"..sga_name.."' not found")
end
config.sga = nil -- avoid multiple inside multiple
config, err = get(config_data, filename, config)
if not config then
return nil, string.format("[%s] %s", sga_name, err)
end
if config.sga_name then
return nil, string.format("sga_name '"..config.sga_name.."' already defined in configuration file "..filename)
end
-- TODO: Dar erro se config do sga escolhido tiver sga_name
config.sga_name = sga_name
return config
......
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