25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-24 16:23:40 +01:00

If command crashes, return restuple with error and explanation (ejabberd-contrib #21)

This commit is contained in:
Badlop 2015-03-25 13:56:42 +01:00
parent 33c9f21171
commit d9ad26b4ec

View File

@ -317,7 +317,13 @@ execute_command2(Command, Arguments) ->
Module = Command#ejabberd_commands.module,
Function = Command#ejabberd_commands.function,
?DEBUG("Executing command ~p:~p with Args=~p", [Module, Function, Arguments]),
apply(Module, Function, Arguments).
try apply(Module, Function, Arguments) of
Response ->
Response
catch
Problem ->
{error, Problem}
end.
-spec get_tags_commands() -> [{string(), [string()]}].