From 8233b4d3e6e9da315144811467f7e0240946f8d9 Mon Sep 17 00:00:00 2001 From: SisMaker <1713699517@qq.com> Date: Sat, 5 Dec 2020 17:30:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/testCase/utTryCatchCase.erl | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/testCase/utTryCatchCase.erl b/src/testCase/utTryCatchCase.erl index 765f6cc..5815133 100644 --- a/src/testCase/utTryCatchCase.erl +++ b/src/testCase/utTryCatchCase.erl @@ -238,7 +238,14 @@ testTryCatch2(Type, TestLoop) -> Type:Reason:Strace -> case TestLoop of true -> Strace; - false -> io:format("try .. catch block caught exception of ~p: ~p: ~p:~n", [Type, Reason, Strace]) + false -> + S1 = utParseStack:parseStack(Strace), + S2 = utParseStack:parseStack(element(2, erlang:process_info(self(), current_stacktrace))), + io:format(S1), + io:format(S2), + io:format("try .. catch block caught exception of ~p: ~p: ~n ~s:~n", [Type, Reason, io_lib:format(S1, [])]), + io:format("try .. catch block caught exception of ~p: ~p: ~n ~s:~n", [Type, Reason, io_lib:format(S2, [])]) + end end.