24
1
mirror of https://github.com/processone/ejabberd.git synced 2024-06-02 21:17:12 +02:00

Generate better errors when not being able to generate documentation

This commit is contained in:
Paweł Chmielowski 2017-06-19 16:30:45 +02:00
parent 96d385bf82
commit 5424ead01d

View File

@ -374,6 +374,7 @@ gen_doc(#ejabberd_commands{name=Name, tags=_Tags, desc=Desc, longdesc=LongDesc,
?TAG_R(dd, ResultDesc)])] ?TAG_R(dd, ResultDesc)])]
end, end,
try
[?TAG(h1, [?TAG(strong, atom_to_list(Name)), <<" - ">>, ?RAW(Desc)]), [?TAG(h1, [?TAG(strong, atom_to_list(Name)), <<" - ">>, ?RAW(Desc)]),
?TAG(p, ?RAW(LDesc)), ?TAG(p, ?RAW(LDesc)),
?TAG(h2, <<"Arguments:">>), ?TAG(h2, <<"Arguments:">>),
@ -381,7 +382,13 @@ gen_doc(#ejabberd_commands{name=Name, tags=_Tags, desc=Desc, longdesc=LongDesc,
?TAG(h2, <<"Result:">>), ?TAG(h2, <<"Result:">>),
ResultText, ResultText,
?TAG(h2, <<"Examples:">>), ?TAG(h2, <<"Examples:">>),
gen_calls(Cmd, HTMLOutput, Langs)]. 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() -> find_commands_definitions() ->
case code:lib_dir(ejabberd, ebin) of case code:lib_dir(ejabberd, ebin) of