diff options
author | Björn Gustavsson <[email protected]> | 2017-05-11 12:51:04 +0200 |
---|---|---|
committer | GitHub <[email protected]> | 2017-05-11 12:51:04 +0200 |
commit | c3a81d86c0ad0245cd47ff17aee70dc816c07e39 (patch) | |
tree | f21ea993bd379ebb960bc896c15532aae9e00f09 /lib/stdlib/src | |
parent | 5aa7180ae0ad7a34d1903003cbcd4a7d5cc61858 (diff) | |
parent | 5d7e12f4d037f74602029850bbd29e38c3732b48 (diff) | |
download | otp-c3a81d86c0ad0245cd47ff17aee70dc816c07e39.tar.gz otp-c3a81d86c0ad0245cd47ff17aee70dc816c07e39.tar.bz2 otp-c3a81d86c0ad0245cd47ff17aee70dc816c07e39.zip |
Merge pull request #1449 from bjorng/bjorn/future-proof-exceptions
Make calls to get_stacktrace/0 future-proof
OTP-14400
Diffstat (limited to 'lib/stdlib/src')
-rw-r--r-- | lib/stdlib/src/qlc.erl | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/stdlib/src/qlc.erl b/lib/stdlib/src/qlc.erl index 20aaa2638c..535ca57a6b 100644 --- a/lib/stdlib/src/qlc.erl +++ b/lib/stdlib/src/qlc.erl @@ -1392,8 +1392,10 @@ next_loop(Pid, L, N) when N =/= 0 -> {caught, throw, Error, [?THROWN_ERROR | _]} -> Error; {caught, Class, Reason, Stacktrace} -> - _ = (catch erlang:error(foo)), - erlang:raise(Class, Reason, Stacktrace ++ erlang:get_stacktrace()); + CurrentStacktrace = try erlang:error(foo) + catch error:_ -> erlang:get_stacktrace() + end, + erlang:raise(Class, Reason, Stacktrace ++ CurrentStacktrace); error -> erlang:error({qlc_cursor_pid_no_longer_exists, Pid}) end; |