We're updating the issue view to help you get more done. 

catch receives a RuntimeException rather than the expected checked exception

Description

Expressions passed to try that trigger the use of clojure.lang.Reflector result in their thrown checked exceptions being wrapped in RuntimeException. As a result, the subsequent set of catches won't switch on the expected checked exception.

Attached: patch for regression test that exposes the problem

1 2 3 4 5 6 7 8 9 10 11 (defn- get-exception [expression] (try (eval expression) nil (catch java.lang.Throwable t t))) (deftest catch-receives-checked-exception (are [expression expected-exception] (= expected-exception (type (get-exception expression))) "Eh, I'm pretty safe" nil '(java.io.FileReader. "CAFEBABEx0/idonotexist") java.io.FileNotFoundException)) ; fails

Clojure ML Thread: https://groups.google.com/forum/#!topic/clojure/I5l1YHVMgkI/discussion
Introduced: https://github.com/clojure/clojure/commit/8fda34e4c77cac079b711da59d5fe49b74605553

Environment

None

Status

Assignee

Ben Smith-Mannschott

Reporter

Paul Bauer

Labels

None

Approval

Ok

Patch

Code and Test

Fix versions

Affects versions

Release 1.3

Priority

Major