diff options
author | Siri Hansen <[email protected]> | 2019-03-21 13:00:18 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2019-03-21 13:00:18 +0100 |
commit | da13166940df546d3fb05a71948f1709d72dd354 (patch) | |
tree | d393d759edd8f5a12aa3745ac5807116da55046d /lib/kernel/src/application_controller.erl | |
parent | 270f6adc1085040f906ce6338967da02a7edc834 (diff) | |
parent | 4ff5cdd7ec35201e70e54f908f6a6805d42e5fb1 (diff) | |
download | otp-da13166940df546d3fb05a71948f1709d72dd354.tar.gz otp-da13166940df546d3fb05a71948f1709d72dd354.tar.bz2 otp-da13166940df546d3fb05a71948f1709d72dd354.zip |
Merge pull request #2170 from josevalim/jv-set-env-error
Error on duplicated config apps/keys in -config
Diffstat (limited to 'lib/kernel/src/application_controller.erl')
-rw-r--r-- | lib/kernel/src/application_controller.erl | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/lib/kernel/src/application_controller.erl b/lib/kernel/src/application_controller.erl index 9a8091fb2e..7715dca7c6 100644 --- a/lib/kernel/src/application_controller.erl +++ b/lib/kernel/src/application_controller.erl @@ -537,14 +537,12 @@ check_conf_data(ConfData) when is_list(ConfData) -> {AppName, List} when is_atom(AppName), is_list(List) -> case lists:keymember(AppName, 1, ConfDataRem) of true -> - ?LOG_WARNING("duplicate application config: " ++ atom_to_list(AppName)); + {error, "duplicate application config: " ++ atom_to_list(AppName)}; false -> - ok - end, - - case check_para(List, AppName) of - ok -> check_conf_data(ConfDataRem); - Error -> Error + case check_para(List, AppName) of + ok -> check_conf_data(ConfDataRem); + Error -> Error + end end; {AppName, List} when is_list(List) -> ErrMsg = "application: " @@ -570,15 +568,14 @@ check_para([], _AppName) -> check_para([{Para, Val} | ParaList], AppName) when is_atom(Para) -> case lists:keymember(Para, 1, ParaList) of true -> - ?LOG_WARNING("application: " ++ atom_to_list(AppName) ++ - "; duplicate parameter: " ++ atom_to_list(Para)); + ErrMsg = "application: " ++ atom_to_list(AppName) + ++ "; duplicate parameter: " ++ atom_to_list(Para), + {error, ErrMsg}; false -> - ok - end, - - case check_para_value(Para, Val, AppName) of - ok -> check_para(ParaList, AppName); - {error, _} = Error -> Error + case check_para_value(Para, Val, AppName) of + ok -> check_para(ParaList, AppName); + {error, _} = Error -> Error + end end; check_para([{Para, _Val} | _ParaList], AppName) -> {error, "application: " ++ atom_to_list(AppName) ++ "; invalid parameter name: " ++ |