From 1cc64ae4d2645e3479733f448217bdcfc2380689 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Sat, 11 Jan 2020 21:11:18 +0100 Subject: [PATCH] :bug: Fix `conform` function on uxbox.common.spec. --- common/uxbox/common/spec.cljc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/common/uxbox/common/spec.cljc b/common/uxbox/common/spec.cljc index 10ed85db7..7a04cd07a 100644 --- a/common/uxbox/common/spec.cljc +++ b/common/uxbox/common/spec.cljc @@ -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))