You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I faced a similar problem.
When I try to phrase with Set parameter, I couldn't show self-defined error message
;; Need :a or :b
(s/def::rule #(some #{:a:b} (keys %)))
;; When check {:x 1}, of-course it raises error
(s/explain-data::rule {:x1})
;; When phrase
(p/phrase-first {} ::rule {:x1})
;; It CAN be invoked and show "errro 1"
(p/defphraser #(some #{:a:b} (keys %)) [_ _] "error 1")
;; It CAN NOT be invoked
(p/defphraser #(some my-hash (keys %)) [_ _] "error 2")
;; It CAN NOT be invoked
(p/defphraser #(some my-hash (keys %)) [_ _ my-hash] "error 3")
This library was exactly what I needed. I am having trouble with the defphrase for the following predicate however.
Put together the following code to show the problem.
Despite several attempts I cannot get the phraser dispatching to match. Any help would be appreciated.
The text was updated successfully, but these errors were encountered: