From a91ae03dc639d6c9f20971da8129b14a6c8e1333 Mon Sep 17 00:00:00 2001 From: Maxim Ignatenko Date: Tue, 20 Sep 2011 20:06:29 +0300 Subject: [PATCH] Remove try/catch --- src/mod_muc/mod_muc_room.erl | 42 ++++++++++++++++-------------------- 1 file changed, 18 insertions(+), 24 deletions(-) diff --git a/src/mod_muc/mod_muc_room.erl b/src/mod_muc/mod_muc_room.erl index f7375f5a4..bd26b74d0 100644 --- a/src/mod_muc/mod_muc_room.erl +++ b/src/mod_muc/mod_muc_room.erl @@ -3722,18 +3722,15 @@ get_mucroom_disco_items(StateData) -> % Voice request support is_voice_request({xmlelement, "x", _, _} = Elem) -> - try - case xml:get_tag_attr_s("xmlns", Elem) of - ?NS_XDATA -> - Fields = jlib:parse_xdata_submit(Elem), - lists:foldl( - fun(X,Y) -> - check_voice_request_fields(X,Y) - end, - true, Fields) - end - catch - error: _ -> + case xml:get_tag_attr_s("xmlns", Elem) of + ?NS_XDATA -> + Fields = jlib:parse_xdata_submit(Elem), + lists:foldl( + fun(X,Y) -> + check_voice_request_fields(X,Y) + end, + true, Fields); + _ -> false end; is_voice_request(Els) -> @@ -3795,18 +3792,15 @@ send_voice_request(From, StateData) -> end, Moderators). is_voice_approvement({xmlelement, "x", _, _} = Elem) -> - try - case xml:get_tag_attr_s("xmlns", Elem) of - ?NS_XDATA -> - Fields = jlib:parse_xdata_submit(Elem), - lists:foldl( - fun(X,Y) -> - check_voice_approvement_fields(X,Y) - end, - true, Fields) - end - catch - error: _ -> + case xml:get_tag_attr_s("xmlns", Elem) of + ?NS_XDATA -> + Fields = jlib:parse_xdata_submit(Elem), + lists:foldl( + fun(X,Y) -> + check_voice_approvement_fields(X,Y) + end, + true, Fields); + _ -> false end; is_voice_approvement(Els) ->