Reflector.java wraps checked exceptions in runtime exceptions

On Mon, Oct 3, 2011 at 12:27 PM, Stuart Halloway
<stuart.hallo...@gmail.com> wrote:
> The Google App Engine SDK uses checked exceptions on many of its API
> methods. In many cases, I want to catch these exceptions and do
> something Clojure-friendly with them. With Clojure 1.2.x, I had no
> trouble catching checked exceptions by type, e.g.:
>
> (try
>  (some-app-engine-api-methods-called-here ...)
>  (catch EntityNotFoundException ex ...))
>
> 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.
>
> I don't fully understand the implications of the exception handling
> changes in 1.3 (https://github.com/clojure/clojure/commit/
> 8fda34e4c77cac079b711da59d5fe49b74605553). Does it mean that all
> exceptions coming in from Java code into Clojure will now be wrapped
> in an extra RuntimeException?
>
> Catching checked exceptions seems to work fine. Try e.g.
> (try (throw (java.io.IOException.)) (catch java.io.IOException _ "caught!"))
> I suspect something else is going wrong in the GAE example. Can you narrow
> the code down to a block you can quote in full here?
> Stu
> Stuart Halloway
> Clojure/core
> http://clojure.com
>
> --
> 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



-- 
And what is good, Phaedrus,
And what is not good—
Need we ask anyone to tell us these things?

-- 
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

Reply via email to