Exception thrown from this line:
https://github.com/clojure/clojure/blob/clojure-1.9.0/src/jvm/clojure/lang/ExceptionInfo.java#L31
Due to this call:
https://github.com/clojure/spec.alpha/blob/spec.alpha-0.1.143/src/main/clojure/clojure/spec/test/alpha.clj#L279
if when-not
returns nil, ExceptionInfo
throws exception on line 31.
A naive fix may be:
(apply ex-info (remove nil? (link: "Specification-based check failed" (when-not ...))))
although that is really just masking over the issue and provides no actionable info to the sufferer of the failure.
Unfortunately I have no minimal test case as this is proprietary (and complicated code).
Perhaps the author from reading the code will have more insight.
Here's the full stack trace:
(link: [clojure.lang.ExceptionInfo "ExceptionInfo.java" 31)
(link: clojure.lang.ExceptionInfo "ExceptionInfo.java" 22)
(link: clojure.core$ex_info invokeStatic "core.clj" 4739)
(link: clojure.core$ex_info invoke "core.clj" 4739)
(link: clojure.spec.test.alpha$explain_check invokeStatic "alpha.clj" 277)
(link: clojure.spec.test.alpha$explain_check invoke "alpha.clj" 275)
(link: clojure.spec.test.alpha$check_call invokeStatic "alpha.clj" 295)
(link: clojure.spec.test.alpha$check_call invoke "alpha.clj" 285)
(link: clojure.spec.test.alpha$quick_check$fn__2986 invoke "alpha.clj" 308)
(link: clojure.lang.AFn applyToHelper "AFn.java" 154)
(link: clojure.lang.AFn applyTo "AFn.java" 144)
(link: clojure.core$apply invokeStatic "core.clj" 657)
(link: clojure.core$apply invoke "core.clj" 652)
(link: clojure.test.check.properties$apply_gen$fn__16139$fn__16140 invoke "properties.cljc" 30)
(link: clojure.test.check.properties$apply_gen$fn__16139 invoke "properties.cljc" 29)
(link: clojure.test.check.rose_tree$fmap invokeStatic "rose_tree.cljc" 77)
(link: clojure.test.check.rose_tree$fmap invoke "rose_tree.cljc" 73)
(link: clojure.test.check.generators$fmap$fn__9199 invoke "generators.cljc" 101)
(link: clojure.test.check.generators$gen_fmap$fn__9173 invoke "generators.cljc" 57)
(link: clojure.test.check.generators$call_gen invokeStatic "generators.cljc" 41)
(link: clojure.test.check.generators$call_gen invoke "generators.cljc" 37)
(link: clojure.test.check$quick_check invokeStatic "check.cljc" 94)
(link: clojure.test.check$quick_check doInvoke "check.cljc" 37)
(link: clojure.lang.RestFn invoke "RestFn.java" 425)
(link: clojure.lang.AFn applyToHelper "AFn.java" 156)
(link: clojure.lang.RestFn applyTo "RestFn.java" 132)
(link: clojure.core$apply invokeStatic "core.clj" 657)
(link: clojure.core$apply invoke "core.clj" 652)
(link: clojure.spec.gen.alpha$quick_check invokeStatic "alpha.clj" 29)
(link: clojure.spec.gen.alpha$quick_check doInvoke "alpha.clj" 27)
(link: clojure.lang.RestFn applyTo "RestFn.java" 137)
(link: clojure.core$apply invokeStatic "core.clj" 661)
(link: clojure.core$apply invoke "core.clj" 652)
(link: clojure.spec.test.alpha$quick_check invokeStatic "alpha.clj" 309)
(link: clojure.spec.test.alpha$quick_check invoke "alpha.clj" 302)
(link: clojure.spec.test.alpha$check_1 invokeStatic "alpha.clj" 335)
(link: clojure.spec.test.alpha$check_1 invoke "alpha.clj" 323)
(link: clojure.spec.test.alpha$check$fn__3005 invoke "alpha.clj" 411)
(link: clojure.core$pmap$fn__8105$fn__8106 invoke "core.clj" 6942)
(link: clojure.core$binding_conveyor_fn$fn__5476 invoke "core.clj" 2022)
(link: clojure.lang.AFn call "AFn.java" 18)
(link: java.util.concurrent.FutureTask run "FutureTask.java" 266)
(link: java.util.concurrent.ThreadPoolExecutor runWorker "ThreadPoolExecutor.java" 1149)
(link: java.util.concurrent.ThreadPoolExecutor$Worker run "ThreadPoolExecutor.java" 624)
(link: java.lang.Thread run "Thread.java" 748)]