Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:19
rabbitmq-server
0003-Use-the-new-try-catch-syntax-to-get-the-st...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0003-Use-the-new-try-catch-syntax-to-get-the-stacktrace-i.patch of Package rabbitmq-server
From 2eef1f1ef4fc720e171e0bc176f74956cd475c6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-S=C3=A9bastien=20P=C3=A9dron?= <jean-sebastien@rabbitmq.com> Date: Thu, 20 Dec 2018 16:31:15 +0100 Subject: [PATCH] Use the new try/catch syntax to get the stacktrace in several testsuites This fixes a warning about `erlang:get_stacktrace()` deprecation by Erlang 21 compiler. (cherry picked from commit 215953e78009bd555ba0b00f41b10fd0a1311db2) --- test/backing_queue_SUITE.erl | 4 ++-- test/dynamic_ha_SUITE.erl | 4 ++-- test/mirrored_supervisor_SUITE.erl | 13 ++++++++----- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/test/backing_queue_SUITE.erl b/test/backing_queue_SUITE.erl index 2ad07d4094..898a377ef6 100644 --- a/test/backing_queue_SUITE.erl +++ b/test/backing_queue_SUITE.erl @@ -1395,8 +1395,8 @@ with_fresh_variable_queue(Fun, Mode) -> shutdown, Fun(VQ1, QName)), Me ! Ref catch - Type:Error -> - Me ! {Ref, Type, Error, erlang:get_stacktrace()} + Type:Error:Stacktrace -> + Me ! {Ref, Type, Error, Stacktrace} end end), receive diff --git a/test/dynamic_ha_SUITE.erl b/test/dynamic_ha_SUITE.erl index 8b9d04aa5b..89ed9b2872 100644 --- a/test/dynamic_ha_SUITE.erl +++ b/test/dynamic_ha_SUITE.erl @@ -620,8 +620,8 @@ get_stacktrace() -> try throw(e) catch - _:e -> - erlang:get_stacktrace() + _:e:Stacktrace -> + Stacktrace end. %%---------------------------------------------------------------------------- diff --git a/test/mirrored_supervisor_SUITE.erl b/test/mirrored_supervisor_SUITE.erl index 321611eaa2..ad19aea23b 100644 --- a/test/mirrored_supervisor_SUITE.erl +++ b/test/mirrored_supervisor_SUITE.erl @@ -294,14 +294,17 @@ get_group(Group) -> call(Id, Msg) -> call(Id, Msg, 10*1000, 100). -call(Id, Msg, 0, _Decr) -> - exit({timeout_waiting_for_server, {Id, Msg}, erlang:get_stacktrace()}); - call(Id, Msg, MaxDelay, Decr) -> + call(Id, Msg, MaxDelay, Decr, undefined). + +call(Id, Msg, 0, _Decr, Stacktrace) -> + exit({timeout_waiting_for_server, {Id, Msg}, Stacktrace}); + +call(Id, Msg, MaxDelay, Decr, _) -> try gen_server:call(Id, Msg, infinity) - catch exit:_ -> timer:sleep(Decr), - call(Id, Msg, MaxDelay - Decr, Decr) + catch exit:_:Stacktrace -> timer:sleep(Decr), + call(Id, Msg, MaxDelay - Decr, Decr, Stacktrace) end. kill(Pid) -> kill(Pid, []). -- 2.35.3
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor