diff --git a/CHANGELOG.md b/CHANGELOG.md index 55cab06d..acfa86c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ * [over 40% faster](https://metosin.github.io/reitit/performance.html) on the JVM * **BREAKING**: `reitit.spec/validate-spec!` has been renamed to `validate` +* With `clojure.spec` coercion, values flow through both `st/coerce` & `st/conform` yielding better error messages. Original issue in [compojure-api](https://github.com/metosin/compojure-api/issues/409). ### `reitit-dev` diff --git a/modules/reitit-core/src/reitit/exception.cljc b/modules/reitit-core/src/reitit/exception.cljc index 79cbad2b..5eb6e524 100644 --- a/modules/reitit-core/src/reitit/exception.cljc +++ b/modules/reitit-core/src/reitit/exception.cljc @@ -12,6 +12,7 @@ (defn exception [e] (let [data (ex-data e) message (format-exception (:type data) #?(:clj (.getMessage ^Exception e) :cljs (ex-message e)) (:data data))] + ;; there is a 3-arity version (+cause) of ex-info, but the default repl error message is taken from the cause (ex-info message (assoc (or data {}) ::cause e)))) ;;