Use ejabberd_sql:abort/1 instead of exit/1
This commit is contained in:
parent
178a0a3e1b
commit
5087e9c2df
|
@ -105,16 +105,16 @@ activate_stream(SID, IJID, MaxConnections, _Node) ->
|
||||||
?SQL("select @(count(*))d from proxy65 "
|
?SQL("select @(count(*))d from proxy65 "
|
||||||
"where jid_i=%(IJID)s")) of
|
"where jid_i=%(IJID)s")) of
|
||||||
{selected, [{Num}]} when Num > MaxConnections ->
|
{selected, [{Num}]} when Num > MaxConnections ->
|
||||||
exit({limit, IPid, TPid});
|
ejabberd_sql:abort({limit, IPid, TPid});
|
||||||
{selected, _} ->
|
{selected, _} ->
|
||||||
{ok, IPid, TPid};
|
{ok, IPid, TPid};
|
||||||
Err ->
|
Err ->
|
||||||
exit(Err)
|
ejabberd_sql:abort(Err)
|
||||||
end;
|
end;
|
||||||
{updated, _} ->
|
{updated, _} ->
|
||||||
{ok, IPid, TPid};
|
{ok, IPid, TPid};
|
||||||
Err ->
|
Err ->
|
||||||
exit(Err)
|
ejabberd_sql:abort(Err)
|
||||||
end
|
end
|
||||||
catch _:{bad_node, _} ->
|
catch _:{bad_node, _} ->
|
||||||
{error, notfound}
|
{error, notfound}
|
||||||
|
@ -124,7 +124,7 @@ activate_stream(SID, IJID, MaxConnections, _Node) ->
|
||||||
{selected, _} ->
|
{selected, _} ->
|
||||||
{error, notfound};
|
{error, notfound};
|
||||||
Err ->
|
Err ->
|
||||||
exit(Err)
|
ejabberd_sql:abort(Err)
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
case ejabberd_sql:sql_transaction(?MYNAME, F) of
|
case ejabberd_sql:sql_transaction(?MYNAME, F) of
|
||||||
|
|
Loading…
Reference in New Issue