On Mon, Oct 3, 2011 at 12:03 PM, Constantine Vetoshev <gepar...@gmail.com> wrote: > This stopped working in 1.3.0. The caught exception does not match > EntityNotFoundException; it is now a RuntimeException with the > original typed exception chained to it.
This caused me some pain in clojure.java.jdbc and I actually catch RuntimeException inside the library and unwrap it and throw the underlying SQLException (for transactions): ;; This ugliness makes it easier to catch SQLException objects ;; rather than something wrapped in a RuntimeException which ;; can really obscure your code when working with JDBC from ;; Clojure... :( (letfn [(throw-non-rte [ex] (cond (instance? java.sql.SQLException ex) (throw ex) (and (instance? RuntimeException ex) (.getCause ex)) (throw-non-rte (.getCause ex)) :else (throw ex)))] (throw-non-rte e))) I've had to do similar things in my own code to get at the underlying exceptions... It would be much, much friendlier to have (try .. (catch ..)) automatically unroll RuntimeException "on demand" so the "obvious" code works. -- Sean A Corfield -- (904) 302-SEAN An Architect's View -- http://corfield.org/ World Singles, LLC. -- http://worldsingles.com/ Railo Technologies, Inc. -- http://www.getrailo.com/ "Perfection is the enemy of the good." -- Gustave Flaubert, French realist novelist (1821-1880) -- 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 Note that posts from new members are moderated - please be patient with your first post. 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