Document spec-tools change + cause reasoning

This commit is contained in:
Tommi Reiman 2019-03-04 09:41:15 +02:00
parent 161fd1dfb0
commit 76b90d3598
2 changed files with 2 additions and 0 deletions

View file

@ -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`

View file

@ -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))))
;;