clojure.test does not print ex-info in error reports

Description

clojure.test does not print the data attached to ExceptionInfo in error reports.

Approach: In clojure.stacktrace, which clojure.test uses for printing exceptions, add a check for ex-data and pr it.

After:

Patch: 0002-CLJ-1209-show-ex-data-in-clojure-test.patch

Screened by: Alex Miller

Environment

None

Activity

Show:
Ivan Kozik
July 13, 2014, 4:35 AM

Attaching sample output

Stuart Sierra
September 5, 2014, 9:24 PM

As pointed out on IRC, there's a possible risk of trying to print an infinite lazy sequence that happened to be included in ex-data.

To mitigate, consider binding print-length and print-level to small numbers around the call to pr.

import
May 13, 2015, 8:39 PM

Comment made by: scgilardi

http://dev.clojure.org/jira/browse/CLJ-1716 may cover this well enough that this issue can be closed.

Alex Miller
May 14, 2015, 2:35 PM

I don't think 1716 covers it at all as clojure.test/clojure.stacktrace don't use the new throwable printing. But they could! And that might be a better solution than the patch here.

For example, the existing patch does not consider what to do about nested exceptions, some of which might have ex-data. The new printer handles all that in a consistent way.

Ed Bowler
December 22, 2016, 5:35 PM
Completed

Assignee

Unassigned

Reporter

Thomas Heller

Labels

Approval

Ok

Patch

Code

Fix versions

Priority

Major
Configure