diff options
author | Daniil Fedotov <[email protected]> | 2019-04-26 16:53:56 -0400 |
---|---|---|
committer | Dan Gudmundsson <[email protected]> | 2019-05-07 09:40:07 +0200 |
commit | d63237bd38059b8468ec4e147cca49b1cf8caac4 (patch) | |
tree | b2ac0696d11f81d0f0ef6b7235fe2d9eaaf883e1 /lib/mnesia/src/mnesia_tm.erl | |
parent | cc804d6650f81617a4a6fd08617be43cf8aa6c2e (diff) | |
download | otp-d63237bd38059b8468ec4e147cca49b1cf8caac4.tar.gz otp-d63237bd38059b8468ec4e147cca49b1cf8caac4.tar.bz2 otp-d63237bd38059b8468ec4e147cca49b1cf8caac4.zip |
Report stacktrace in non-transactions activity function errors.
If an activity function fails with an error, the stacktrace is
dropped in non_transaction function try/catch clause.
This makes debuging of errors inside a transaction really hard.
Transaction activities handle errors and exits differently, non-transaction
activities should do the same.
Adding the stacktrace to the exit reason when translating errors to exits.
Diffstat (limited to 'lib/mnesia/src/mnesia_tm.erl')
-rw-r--r-- | lib/mnesia/src/mnesia_tm.erl | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/mnesia/src/mnesia_tm.erl b/lib/mnesia/src/mnesia_tm.erl index cbf7db28f0..8b79fca1d7 100644 --- a/lib/mnesia/src/mnesia_tm.erl +++ b/lib/mnesia/src/mnesia_tm.erl @@ -743,8 +743,9 @@ non_transaction(OldState, Fun, Args, ActivityKind, Mod) -> {aborted, Reason} -> mnesia:abort(Reason); Res -> Res catch - throw:Throw -> throw(Throw); - _:Reason -> exit(Reason) + throw:Throw -> throw(Throw); + error:Reason:ST -> exit({Reason, ST}); + exit:Reason -> exit(Reason) after case OldState of undefined -> erase(mnesia_activity_state); |