0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-08 16:00:19 -05:00

🐛 Fix conform function on uxbox.common.spec.

This commit is contained in:
Andrey Antukh 2020-01-11 21:11:18 +01:00
parent 74f1f93732
commit 1cc64ae4d2

View file

@ -126,9 +126,10 @@
[spec data]
(let [result (s/conform spec data)]
(when (= result ::s/invalid)
(throw (ex/error :type :validation
:code :spec-validation
:explain (with-out-str
(expound/printer data))
:data (::s/problems data))))
(let [edata (s/explain-data spec data)]
(throw (ex/error :type :validation
:code :spec-validation
:explain (with-out-str
(expound/printer edata))
:data (::s/problems edata)))))
result))