Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
csbase-dev
sgarest-daemon
Commits
f85e4755
Commit
f85e4755
authored
Apr 01, 2020
by
Carla Goncalves Ourofino
Browse files
Melhoria de implementação e organização das mensagens.
[SOMA-3827][SOMA-4161]
parent
48894683
Changes
1
Hide whitespace changes
Inline
Side-by-side
sga/configuration.lua
View file @
f85e4755
...
...
@@ -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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment