exoscale / coax

Clojure.spec coercion library for clj(s)
Other
118 stars 4 forks source link

Add explain-data in the exception data #16

Closed mcorbin closed 3 years ago

mcorbin commented 3 years ago

Today, it's hard to understand exactly why a complex spec fails to coerce. This commit adds an :explain-data key to the exception data, which make easier investigating coercion issues.

pyr commented 3 years ago

Since both spec and coerced are available, couldn't this be ran when receiving the exception instead of carrying it in all thrown payloads?