25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-12-24 17:29:28 +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)])]
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