24
1
mirror of https://github.com/processone/ejabberd.git synced 2024-07-14 23:44:18 +02:00

Fix try/catch branch

This commit is contained in:
Evgeniy Khramtsov 2011-07-28 16:04:02 +10:00
parent cb41c8ef80
commit a06b627631

View File

@ -717,7 +717,8 @@ attrs_to_body_attrs(Attrs) ->
fun(_, {error, Reason}) ->
{error, Reason};
({Attr, Val}, Acc) ->
try Attr of
try
case Attr of
"ver" -> [{ver, Val}|Acc];
"xmpp:version" -> [{'xmpp:version', Val}|Acc];
"type" -> [{type, Val}|Acc];
@ -734,6 +735,7 @@ attrs_to_body_attrs(Attrs) ->
"rid" -> [{rid, to_int(Val, 0)}|Acc];
"pause" -> [{pause, to_int(Val, 0)}|Acc];
_ -> [{Attr, Val}|Acc]
end
catch _:_ ->
{error, "Invalid \"" ++ Attr ++ "\" attribute"}
end