mirror of
https://github.com/penpot/penpot.git
synced 2025-02-02 04:19:08 -05:00
✨ Add minor improvement on error reporting on shape validation
This commit is contained in:
parent
e533762f33
commit
7c73e44ab8
3 changed files with 6 additions and 2 deletions
|
@ -63,7 +63,7 @@
|
||||||
(ex/format-throwable cause :data? false :explain? false :header? false :summary? false))}
|
(ex/format-throwable cause :data? false :explain? false :header? false :summary? false))}
|
||||||
|
|
||||||
(when-let [params (or (:request/params context) (:params context))]
|
(when-let [params (or (:request/params context) (:params context))]
|
||||||
{:params (pp/pprint-str params :length 30 :level 12)})
|
{:params (pp/pprint-str params :length 30 :level 13)})
|
||||||
|
|
||||||
(when-let [value (:value context)]
|
(when-let [value (:value context)]
|
||||||
{:value (pp/pprint-str value :length 30 :level 12)})
|
{:value (pp/pprint-str value :length 30 :level 12)})
|
||||||
|
|
|
@ -418,7 +418,8 @@
|
||||||
(cts/shape? shape-new))
|
(cts/shape? shape-new))
|
||||||
(ex/raise :type :assertion
|
(ex/raise :type :assertion
|
||||||
:code :data-validation
|
:code :data-validation
|
||||||
:hint "invalid shape found after applying changes")))))]
|
:hint "invalid shape found after applying changes"
|
||||||
|
::sm/explain (cts/explain-shape shape-new))))))]
|
||||||
|
|
||||||
(->> (into #{} (map :page-id) items)
|
(->> (into #{} (map :page-id) items)
|
||||||
(mapcat (fn [page-id]
|
(mapcat (fn [page-id]
|
||||||
|
|
|
@ -361,6 +361,9 @@
|
||||||
(def valid-shape?
|
(def valid-shape?
|
||||||
(sm/lazy-validator schema:shape))
|
(sm/lazy-validator schema:shape))
|
||||||
|
|
||||||
|
(def explain-shape
|
||||||
|
(sm/lazy-explainer schema:shape))
|
||||||
|
|
||||||
(defn has-images?
|
(defn has-images?
|
||||||
[{:keys [fills strokes]}]
|
[{:keys [fills strokes]}]
|
||||||
(or (some :fill-image fills)
|
(or (some :fill-image fills)
|
||||||
|
|
Loading…
Add table
Reference in a new issue