[CLJ-1102] Better handling of exceptions with empty stack traces Created: 04/Nov/12 Updated: 25/Oct/13 Resolved: 25/Oct/13
|Affects Version/s:||Release 1.5|
|Fix Version/s:||Release 1.6|
|Patch:||Code and Test|
REPL session demonstrating clojure.stacktrace/print-stack-trace and clojure.test/file-and-line throwing exceptions when given Throwable with an empty stack trace:
I have seen this cause confusing output when exceptions with empty stack traces are thrown while running tests on a project. According to the Java docs for Throwable, it is permissible for getStackTrace to do this:
I found all places in the Clojure code that call getStackTrace. Among them, two did not handle an empty stack trace correctly.
Output of tests above with this patch applied:
Screened by: Alex Miller
|Comment by Andy Fingerhut [ 04/Nov/12 5:07 PM ]|
clj-1102-improve-empty-stack-trace-handling-v1.txt dated Nov 4 2012 improves the handling of .getStackTrace returning a length 0 array in two places. I checked all other places .getStackTrace was called and they seem to already handle this case gracefully.
|Comment by Timothy Baldridge [ 30/Nov/12 2:57 PM ]|