Hello, Martin DeMello a écrit : > Playing with readFileToByteArray in the repl: > > user=> (import '(org.apache.commons.io FileUtils)) > nil > > user=> (def dawg (FileUtils/readFileToByteArray "words.dawg")) > java.lang.ClassCastException (NO_SOURCE_FILE:10) > > user=> (FileUtils/readFileToByteArray "words.dawg") > java.lang.ClassCastException: java.lang.String cannot be cast to > java.io.File (NO_SOURCE_FILE:0) > > The second error message was a lot more helpful than the first - why > was the message lost en route? It doesn't always happen: > > user=> (/ 1 0) > java.lang.ArithmeticException: Divide by zero (NO_SOURCE_FILE:0) > > user=> (def a (/ 1 0)) > java.lang.ArithmeticException: Divide by zero (NO_SOURCE_FILE:18) >
You can access the latest exception through the var *e. eg (.printStackTrace *e) will print the whole stack trace. Worth looking is also clojure.contrib.stacktrace that tries to make Java stack traces more readable. HTH Christophe -- Professional: http://cgrand.net/ (fr) On Clojure: http://clj-me.blogspot.com/ (en) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~----------~----~----~----~------~----~------~--~---