]> granicus.if.org Git - ejabberd/commitdiff
Provide a suggestion when unknown request handler is detected
authorEvgeny Khramtsov <ekhramtsov@process-one.net>
Tue, 30 Apr 2019 07:31:03 +0000 (10:31 +0300)
committerEvgeny Khramtsov <ekhramtsov@process-one.net>
Tue, 30 Apr 2019 07:31:03 +0000 (10:31 +0300)
src/ejabberd_http.erl

index e37269659a47c9c95b97fa06b60f6cd80a9c2c56..d9e13132e55cb1944f513a3e8cb3b56a3874cdcf 100644 (file)
@@ -971,10 +971,13 @@ prepare_request_module(Mod) when is_atom(Mod) ->
            Mod;
        Err ->
            ?ERROR_MSG(
-              "Failed to load request handler ~s: "
+              "Failed to load request handler ~s, "
+              "did you mean ~s? Hint: "
               "make sure there is no typo and file ~s.beam "
               "exists inside either ~s or ~s directory",
-              [Mod, Mod,
+              [Mod,
+               misc:best_match(Mod, ejabberd_config:get_modules()),
+               Mod,
                filename:dirname(code:which(?MODULE)),
                ext_mod:modules_dir()]),
            erlang:error(Err)