25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-30 16:36:29 +01: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,14 +374,21 @@ gen_doc(#ejabberd_commands{name=Name, tags=_Tags, desc=Desc, longdesc=LongDesc,
?TAG_R(dd, ResultDesc)])] ?TAG_R(dd, ResultDesc)])]
end, end,
[?TAG(h1, [?TAG(strong, atom_to_list(Name)), <<" - ">>, ?RAW(Desc)]), try
?TAG(p, ?RAW(LDesc)), [?TAG(h1, [?TAG(strong, atom_to_list(Name)), <<" - ">>, ?RAW(Desc)]),
?TAG(h2, <<"Arguments:">>), ?TAG(p, ?RAW(LDesc)),
ArgsText, ?TAG(h2, <<"Arguments:">>),
?TAG(h2, <<"Result:">>), ArgsText,
ResultText, ?TAG(h2, <<"Result:">>),
?TAG(h2, <<"Examples:">>), ResultText,
gen_calls(Cmd, HTMLOutput, Langs)]. ?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() -> find_commands_definitions() ->
case code:lib_dir(ejabberd, ebin) of case code:lib_dir(ejabberd, ebin) of