Catch all p1_fsm errors

Fixes #2012
This commit is contained in:
Evgeniy Khramtsov 2017-09-25 13:01:00 +03:00
parent 3e987d3bae
commit 251756de00
1 changed files with 3 additions and 3 deletions

View File

@ -681,7 +681,7 @@ iq_disco_items(_ServerHost, _Host, _From, Lang, _MaxRoomsDiscoItems, _Node, _RSM
-spec get_room_disco_item({binary(), binary(), pid()},
term()) -> {ok, disco_item()} |
{error, timeout | notfound}.
{error, timeout | notfound}.
get_room_disco_item({Name, Host, Pid}, Query) ->
RoomJID = jid:make(Name, Host),
try p1_fsm:sync_send_all_state_event(Pid, Query, 100) of
@ -689,9 +689,9 @@ get_room_disco_item({Name, Host, Pid}, Query) ->
{ok, #disco_item{jid = RoomJID, name = Desc}};
false ->
{error, notfound}
catch _:{timeout, _} ->
catch _:{timeout, {p1_fsm, _, _}} ->
{error, timeout};
_:{noproc, _} ->
_:{_, {p1_fsm, _, _}} ->
{error, notfound}
end.