aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDan Gudmundsson <[email protected]>2017-11-14 12:11:48 +0100
committerDan Gudmundsson <[email protected]>2017-11-14 12:11:48 +0100
commitb0019accbd2ad3f5f433a8ca0c877f3bf8456f92 (patch)
tree3417015f168aa887ab28ae7d08120f6b3ec18491 /lib
parent2cc46961352aded5c84ecb9bcb32581461dbc047 (diff)
downloadotp-b0019accbd2ad3f5f433a8ca0c877f3bf8456f92.tar.gz
otp-b0019accbd2ad3f5f433a8ca0c877f3bf8456f92.tar.bz2
otp-b0019accbd2ad3f5f433a8ca0c877f3bf8456f92.zip
mnesia: Fix error handling in abort write
The "root cause" error reason was lost when abort_write failed, e.g. file was already closed, and Mod:abort_write(..) returned an error.
Diffstat (limited to 'lib')
-rw-r--r--lib/mnesia/src/mnesia_log.erl4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/mnesia/src/mnesia_log.erl b/lib/mnesia/src/mnesia_log.erl
index 9536effd42..685d512acf 100644
--- a/lib/mnesia/src/mnesia_log.erl
+++ b/lib/mnesia/src/mnesia_log.erl
@@ -752,8 +752,8 @@ abort_write(B, What, Args, Reason) ->
Opaque = B#backup_args.opaque,
dbg_out("Failed to perform backup. M=~p:F=~p:A=~p -> ~p~n",
[Mod, What, Args, Reason]),
- try apply(Mod, abort_write, [Opaque]) of
- {ok, _Res} -> throw({error, Reason})
+ try {ok, _Res} = apply(Mod, abort_write, [Opaque]) of
+ _ -> throw({error, Reason})
catch _:Other ->
error("Failed to abort backup. ~p:~p~p -> ~p~n",
[Mod, abort_write, [Opaque], Other]),