Hi clojurians,
I was happily clojure-coding whent I tried to catch a exception in a
thrown deeply in a function.
After looking for the fact that the IllegalArgumentException wasn't
catch, I added a catch RuntimeException to my catch list ... and that
worked of course.
Here is the simplified case:
(defn throw-error [arg]
(throw (IllegalArgumentException. (str arg))))
(try
(let [ test
(into {}
(map (fn[x] (if (= 5 x) (throw-error x) [x x]))
[1 2 3 4 5])) ]
(str "NO PB " name))
(catch IllegalArgumentException e (.getMessage e))
(catch RuntimeException e (str "RT" (.getMessage e)))
)
If you comment the RuntimeException catch, the exception is not
catched.
I don't understand why IllegalArgumentException is not catched ...
Somebody could tell me ?
Thanks
Phil
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
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
-~----------~----~----~----~------~----~------~--~---