aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ejabberd_commands_doc.erl23
1 files changed, 15 insertions, 8 deletions
diff --git a/src/ejabberd_commands_doc.erl b/src/ejabberd_commands_doc.erl
index 142f23c9c..68fb05765 100644
--- a/src/ejabberd_commands_doc.erl
+++ b/src/ejabberd_commands_doc.erl
@@ -374,14 +374,21 @@ gen_doc(#ejabberd_commands{name=Name, tags=_Tags, desc=Desc, longdesc=LongDesc,
?TAG_R(dd, ResultDesc)])]
end,
- [?TAG(h1, [?TAG(strong, atom_to_list(Name)), <<" - ">>, ?RAW(Desc)]),
- ?TAG(p, ?RAW(LDesc)),
- ?TAG(h2, <<"Arguments:">>),
- ArgsText,
- ?TAG(h2, <<"Result:">>),
- ResultText,
- ?TAG(h2, <<"Examples:">>),
- gen_calls(Cmd, HTMLOutput, Langs)].
+ try
+ [?TAG(h1, [?TAG(strong, atom_to_list(Name)), <<" - ">>, ?RAW(Desc)]),
+ ?TAG(p, ?RAW(LDesc)),
+ ?TAG(h2, <<"Arguments:">>),
+ ArgsText,
+ ?TAG(h2, <<"Result:">>),
+ ResultText,
+ ?TAG(h2, <<"Examples:">>),
+ gen_calls(Cmd, HTMLOutput, Langs)]
+ catch
+ _:Ex ->
+ throw(iolist_to_binary(io_lib:format(
+ <<"Error when generating documentation for command '~p': ~p">>,
+ [Name, Ex])))
+ end.
find_commands_definitions() ->
case code:lib_dir(ejabberd, ebin) of