make spec check message more clear

This commit is contained in:
Artur Girenko 2016-10-31 18:44:24 +01:00
parent 42f0ad0df9
commit aa6e476c03
1 changed files with 2 additions and 2 deletions

View File

@ -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