diff options
author | Evgeny Khramtsov <ekhramtsov@process-one.net> | 2019-07-29 21:44:30 +0300 |
---|---|---|
committer | Evgeny Khramtsov <ekhramtsov@process-one.net> | 2019-07-29 21:44:30 +0300 |
commit | 2cd930b7d5fc549282974fbf05cf5d65a4a38edb (patch) | |
tree | 1be257df4d08151fd488a23195498d87521343f8 /src/mod_pubsub.erl | |
parent | mod_multicast service discovery bugfix (thanks to McPo)(#2968) (diff) |
Appropriately abort pubsub transaction
Diffstat (limited to 'src/mod_pubsub.erl')
-rw-r--r-- | src/mod_pubsub.erl | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/mod_pubsub.erl b/src/mod_pubsub.erl index 8dbe9cb98..464668874 100644 --- a/src/mod_pubsub.erl +++ b/src/mod_pubsub.erl @@ -3806,9 +3806,15 @@ transaction(Host, Fun, Trans) -> do_transaction(ServerHost, Fun, Trans, DBType) -> F = 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), - 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, Res = case DBType of |