mirror of
https://github.com/status-im/re-natal.git
synced 2025-02-03 08:14:21 +00:00
Merge pull request #76 from mozinator/patch-1
Logging the message where the error originates
This commit is contained in:
commit
42f0ad0df9
@ -10,10 +10,10 @@
|
|||||||
;;
|
;;
|
||||||
(defn check-and-throw
|
(defn check-and-throw
|
||||||
"Throw an exception if db doesn't have a valid spec."
|
"Throw an exception if db doesn't have a valid spec."
|
||||||
[spec db]
|
[spec db [msg]]
|
||||||
(when-not (s/valid? spec db)
|
(when-not (s/valid? spec db)
|
||||||
(let [explain-data (s/explain-data spec db)]
|
(let [explain-data (s/explain-data spec db)]
|
||||||
(throw (ex-info (str "Spec check failed: " explain-data) explain-data)))))
|
(throw (ex-info (str "Spec check " msg " failed: " explain-data) explain-data)))))
|
||||||
|
|
||||||
(def validate-spec
|
(def validate-spec
|
||||||
(if goog.DEBUG
|
(if goog.DEBUG
|
||||||
|
Loading…
x
Reference in New Issue
Block a user