I believe the actual problem comes from things like RT.classForName(),
which internally catches a ClassNotFoundException, and then does this:

                throw Util.runtimeException(e);

That ends up just sort of obscuring what the exception is, and you
can't just catch ClassNotFoundException - you have to catch the
RuntimeException, and then figure out what it really means if you
actually have to respond to a specific case. I'm not a particular fan
of checked exceptions, but I don't entirely understand the rationale
behind this.

On Oct 3, 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/corehttp://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

Reply via email to