]> granicus.if.org Git - ejabberd/commitdiff
Improve some error log messages
authorEvgeniy Khramtsov <ekhramtsov@process-one.net>
Wed, 15 Nov 2017 08:54:38 +0000 (11:54 +0300)
committerEvgeniy Khramtsov <ekhramtsov@process-one.net>
Wed, 15 Nov 2017 08:54:38 +0000 (11:54 +0300)
src/ejabberd_listener.erl
src/gen_mod.erl

index e9b4306e54d7f23a9f4a4e0d7602c7a0108d3c47..248e3faf06f88d930c7f9b89826ab01341ffcd5d 100644 (file)
@@ -606,6 +606,11 @@ validate_module_option(Module, Opt, Val) ->
                               [Opt, Val]),
                    error
            end;
+       [] ->
+           ?ERROR_MSG("unknown listen option '~s' for '~s' will be likely "
+                      "ignored because the listening module doesn't have "
+                      "any options", [Opt, Module]),
+           {ok, Val};
        KnownOpts when is_list(KnownOpts) ->
            ?ERROR_MSG("unknown listen option '~s' for '~s' will be likely "
                       "ignored, available options are: ~s",
index e17197dfb5732fde977cf1600ac5479d9c8b342f..73041509114edfb1f07eef86acf76b555d26e7b6 100644 (file)
@@ -526,11 +526,19 @@ validate_opts(Host, Module, Opts, Validators) when is_list(Opts) ->
                              end
                      end;
                  false ->
-                     ?ERROR_MSG("unknown option '~s' for module '~s' will be"
-                                " likely ignored, available options are: ~s",
-                                [Opt, Module,
-                                 misc:join_atoms([K || {K, _} <- Validators],
-                                                 <<", ">>)]),
+                     case Validators of
+                         [] ->
+                             ?ERROR_MSG("unknown option '~s' for module '~s' "
+                                        "will be likely ignored because the "
+                                        "module doesn't have any options",
+                                        [Opt, Module]);
+                         _ ->
+                             ?ERROR_MSG("unknown option '~s' for module '~s' will be"
+                                        " likely ignored, available options are: ~s",
+                                        [Opt, Module,
+                                         misc:join_atoms([K || {K, _} <- Validators],
+                                                         <<", ">>)])
+                     end,
                      [{Opt, Val}]
              end;
         (_) ->