mirror of
https://github.com/penpot/penpot.git
synced 2026-08-01 10:56:20 +00:00
🐛 Fix corrner case on error report validationt
This commit is contained in:
parent
1b6a833166
commit
39bdf026ca
@ -80,7 +80,7 @@
|
|||||||
[:file-id ::sm/uuid]
|
[:file-id ::sm/uuid]
|
||||||
[:page-id {:optional true} [:maybe ::sm/uuid]]])
|
[:page-id {:optional true} [:maybe ::sm/uuid]]])
|
||||||
|
|
||||||
(def check-error!
|
(def check-error
|
||||||
(sm/check-fn schema:error))
|
(sm/check-fn schema:error))
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
@ -96,21 +96,17 @@
|
|||||||
|
|
||||||
(defn- report-error
|
(defn- report-error
|
||||||
[code hint shape file page & {:as args}]
|
[code hint shape file page & {:as args}]
|
||||||
(let [error {:code code
|
(let [error (d/without-nils
|
||||||
:hint hint
|
{:code code
|
||||||
:shape shape
|
:hint hint
|
||||||
:file-id (:id file)
|
:shape shape
|
||||||
:page-id (:id page)
|
:file-id (:id file)
|
||||||
:shape-id (:id shape)
|
:page-id (:id page)
|
||||||
:args args}]
|
:shape-id (:id shape)
|
||||||
|
:args args})]
|
||||||
|
|
||||||
(dm/assert!
|
(assert (some? *errors*) "expected a valid `*errors*` dynamic binding")
|
||||||
"expected a valid `*errors*` dynamic binding"
|
(assert (check-error error))
|
||||||
(some? *errors*))
|
|
||||||
|
|
||||||
(dm/assert!
|
|
||||||
"expected valid error"
|
|
||||||
(check-error! error))
|
|
||||||
|
|
||||||
(vswap! *errors* conj error)))
|
(vswap! *errors* conj error)))
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user