Completed
Details
Assignee
UnassignedUnassignedReporter
Andy FingerhutAndy FingerhutApproval
OkPatch
Code and TestPriority
MinorAffects versions
Fix versions
Details
Details
Assignee
Unassigned
UnassignedReporter
Andy Fingerhut
Andy FingerhutApproval
Ok
Patch
Code and Test
Priority
Affects versions
Fix versions
Created June 4, 2015 at 6:09 PM
Updated June 17, 2015 at 4:58 PM
Resolved June 17, 2015 at 4:58 PM
Clojure error reporting changed in CLJ-1169 to wrap exceptions thrown during macro evaluation in CompilerException to give more input:
Clojure 1.6
(defmacro demo [] (throw (ex-info "fail" {}))) (demo) ExceptionInfo fail clojure.core/ex-info (core.clj:4403) (class *e) => clojure.lang.ExceptionInfo
Clojure 1.7.0-alpha2 to 1.7.0-RC1
(defmacro demo [] (throw (ex-info "fail" {}))) (demo) ExceptionInfo fail clojure.core/ex-info (core.clj:4403) ;; NOTE: lein repl will instead print: CompilerException clojure.lang.ExceptionInfo: fail {}, compiling:(form-init8304622754337237403.clj:1:1) (class *e) => clojure.lang.Compiler$CompilerException
This change has caused some breakage for users that throw exceptions in macros and expect to see the same exception at the top of the exception chain, not wrapped in a CompilerException. This change is somewhat masked in the Clojure REPL because clojure.main/root-cause unwraps CompilerException wrappers and prints the root cause when an exception occurs.
More background can be found in some messages on:
https://groups.google.com/d/msg/clojure/ccZuKTYKDPc/xpaz44UDqYwJ
Approach: The attached patch rolls back most of the change for CLJ-1169, specifically the part that wraps exceptions in CompilerException and the tests that were affected by this change (good examples of the kind of breakage others are seeing). I left the parts of CLJ-1169 that added quotes in the error message and those equivalent tests.
Patch: clj-1745.patch