clj-stacktrace.rpl/pst-on raises IndexOutOfBoundsException for exceptions with stack traces one or two elements deep #26
This was referenced Aug 19, 2013
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The following code raises a
java.lang.ArithmeticExceptionwith an one-element stack trace thatclj-stacktrace.repl/find-source-widthcan't handle, so anIndexOutOfBoundsExceptionis raised when trying to print it. Versions used:[clj-stacktrace "0.2.6"]and[org.clojure/tools.trace "0.7.5"].clojure.tools.trace/trace-formscreates an exception with a single element in his stacktrace (checkclojure.tools.trace/trace-compose-exception). When this exception is parsed byclj-stacktrace.core/parse-exceptionyou get something like this:but
clj-stacktrace.utils/quartile3is BROKEN for one-element collections, so when is called (afterpst-on -> find-source-width -> utils/fence) it fails on the following expression:Simple test:
I think this bug is related to the following closed ticket:
#20
But the @jonpither fix in that ticket didn't resolved this problem. It happens in clj-stacktrace
0.2.5before the fix and after the fix was merged in0.2.6.