mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-28 16:34:13 +01:00
Appropriately abort pubsub transaction
This commit is contained in:
parent
630cfe26b7
commit
2cd930b7d5
@ -3806,9 +3806,15 @@ transaction(Host, Fun, Trans) ->
|
|||||||
do_transaction(ServerHost, Fun, Trans, DBType) ->
|
do_transaction(ServerHost, Fun, Trans, DBType) ->
|
||||||
F = fun() ->
|
F = fun() ->
|
||||||
try Fun()
|
try Fun()
|
||||||
catch ?EX_RULE(Class, Reason, St) ->
|
catch ?EX_RULE(Class, Reason, St) when (DBType == mnesia andalso
|
||||||
|
Trans == transaction) orelse
|
||||||
|
DBType == sql ->
|
||||||
StackTrace = ?EX_STACK(St),
|
StackTrace = ?EX_STACK(St),
|
||||||
mnesia:abort({exception, Class, Reason, StackTrace})
|
Ex = {exception, Class, Reason, StackTrace},
|
||||||
|
case DBType of
|
||||||
|
mnesia -> mnesia:abort(Ex);
|
||||||
|
sql -> ejabberd_sql:abort(Ex)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
Res = case DBType of
|
Res = case DBType of
|
||||||
|
Loading…
Reference in New Issue
Block a user