]> granicus.if.org Git - ejabberd/commitdiff
Mention configuration file path in error messages
authorHolger Weiss <holger@zedat.fu-berlin.de>
Wed, 11 Jun 2014 13:03:33 +0000 (15:03 +0200)
committerHolger Weiss <holger@zedat.fu-berlin.de>
Wed, 11 Jun 2014 13:03:33 +0000 (15:03 +0200)
If reading or parsing a YAML configuration fails, log the full path to
the configuration file (as we do for old-style ".cfg" files).

src/ejabberd_config.erl

index c0b78d9ba9cc04162b0a8594795365a0b1f6c613..612cd84ceddb9d3180c9ee94a15da1533ea28864 100644 (file)
@@ -186,7 +186,9 @@ consult(File) ->
                 {ok, [Document|_]} ->
                     {ok, Document};
                 {error, Err} ->
-                    {error, p1_yaml:format_error(Err)}
+                    Msg1 = "Cannot load " ++ File ++ ": ",
+                    Msg2 = p1_yaml:format_error(Err),
+                    {error, Msg1 ++ Msg2}
             end;
         _ ->
             case file:consult(File) of