test-is' :error implementation for the report method restricts the
printing of caught exceptions' frames to 5.  I'm finding it very
inconvenient, as many common exceptions have as their first 5-10
frames essentially unhelpful source information.  For example, a
typical IllegalArgumentException thrown by
clojure.lang.AFn.throwArity:

Caused by: java.lang.IllegalArgumentException: Wrong number of args
passed to: namespace$fn
 at clojure.lang.AFn.throwArity (AFn.java:450)
    clojure.lang.RestFn.invoke (RestFn.java:404)
    clojure.lang.AFn.applyToHelper (AFn.java:172)
    clojure.lang.RestFn.applyTo (RestFn.java:137)
    clojure.core$apply__3134.doInvoke (core.clj:382)
    clojure.lang.RestFn.invoke (RestFn.java:428)
    [.... calling code starts here ....]

This amount of unhelpful stack frames can go quite high, depending
upon the frameworks one is using as well.

So, I ask: Is there any particular reason for this? I presume it's for
brevity, but at this point, many of the error reports coming out of
test-is are entirely unhelpful, and there doesn't appear to be any way
backchannel to configure stack trace print depth in
clojure.contrib.stacktrace or test-is.

FWIW, the fix (IMO) is simple: remove the '5' argument to the call to
stacktrace/print-cause-trace in test-is, which will result in all
stack frames being printed. (I would have provided a patch, but I
thought I'd inquire as to the motivation behind the current behaviour
before opening a ticket, etc.)  I suppose some may want to have a
binding to control printed stack trace depth, which would be fine,
too; however, for my part, I would strongly prefer having the default
be Integer/MAX_VALUE or somesuch.

Thanks,

- Chas
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to