Skip to content

Commit

Permalink
[ct_error_printer} Do not format exception when expecting an exception.
Browse files Browse the repository at this point in the history
Summary:
When one uses assertException(..., ...), the "received exeption" was printer using erl_error:format_exception(....), whereas the "expected exception" was not.

This lead to difference in format that made them hard to compare.

In this diff, we print resulted exception using the usual "~p", to make it comparable to the expected one.

Reviewed By: alanz

Differential Revision: D68023395

fbshipit-source-id: e40df50bfb5096fa88712bc5bc31a03ab13cc2ff
  • Loading branch information
Thomas David Cuvillier authored and facebook-github-bot committed Jan 22, 2025
1 parent d01b92e commit 21e68f1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions prelude/erlang/common_test/common/src/ct_error_printer.erl
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,8 @@ format_assert0(
io_lib:format(" got value: ~p~n", [Value]);
#{unexpected_exception := {Class, Reason, StackTrace} = _Exception} ->
io_lib:format(
" got exception: ~s ~n",
[erl_error:format_exception(Class, Reason, StackTrace)]
" got exception: ~p ~n",
[{Class, Reason, StackTrace}]
);
_ ->
unrecognized_error
Expand Down

0 comments on commit 21e68f1

Please sign in to comment.