mirror of
https://github.com/status-im/re-natal.git
synced 2025-01-12 05:34:07 +00:00
make spec check message more clear
This commit is contained in:
parent
42f0ad0df9
commit
aa6e476c03
@ -10,10 +10,10 @@
|
||||
;;
|
||||
(defn check-and-throw
|
||||
"Throw an exception if db doesn't have a valid spec."
|
||||
[spec db [msg]]
|
||||
[spec db [event]]
|
||||
(when-not (s/valid? spec db)
|
||||
(let [explain-data (s/explain-data spec db)]
|
||||
(throw (ex-info (str "Spec check " msg " failed: " explain-data) explain-data)))))
|
||||
(throw (ex-info (str "Spec check after " event " failed: " explain-data) explain-data)))))
|
||||
|
||||
(def validate-spec
|
||||
(if goog.DEBUG
|
||||
|
Loading…
x
Reference in New Issue
Block a user