This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # bangalore-clj (2)
- # beginners (50)
- # boot (21)
- # cljs-dev (2)
- # cljsrn (1)
- # clojure (93)
- # clojure-russia (5)
- # clojure-spec (22)
- # clojure-uk (3)
- # clojurescript (24)
- # data-science (4)
- # datomic (1)
- # events (2)
- # fulcro (46)
- # graphql (9)
- # hoplon (16)
- # lumo (42)
- # off-topic (3)
- # perun (2)
- # protorepl (1)
- # re-frame (10)
- # reagent (12)
- # ring (1)
- # ring-swagger (1)
- # shadow-cljs (12)
- # specter (16)
- # unrepl (10)
is there a way to hijack s/assert 's error messages? I often have situations where: 1. obj is a giant data sttructure 2. obj fails spec ::foo 3. the fact that obj fails can be verified by just loloking at (keys obj) 4. s/assert prints out all of obj, which actuall makes it more difficult to see what is going on
You can also customize the printer e.g.
(defn my-assert [spec val] (binding [s/*explain-out* my-printer] (s/assert spec val)))
my-printerwill take a single argument that is the
explain-data(it’s data like the return value from
It doesn’t actually help in this specific case (it prints out the entire value when it is missing keys), but you can provide a custom function to print out the value in this specific case
in that case, you’ll get the spec-name and some other data, which might be enough to detect this particular case.
Or you could even write your own printer which inspects the
explain-data and does something custom for
keys specs, but passes it along to expound otherwise.
when an assertion happens, I want it to pop up a new browser window, print the first level of the data, have + buttons next to parts that can be expand (and expands when I click on them), and highlights in a red DOM rectangle the key/value pair that is failing the spec
why is https://github.com/jpmonettas/inspectable#specs-fail-explain-why not common knowledge ?
No idea, it seems like a great tool, maybe we need a collection of these helper libraries
wrap it in a try/catch?
how can I look inside the result of an
s/and? - I’d like to dig out the
s/cat contained within it.
Hi! I am getting a cryptic error (to me) when attempting to build my ClojureScript project for production (with advanced opts). Could someone please take a look? https://gist.github.com/hmaurer/1d30b39c8e28e646ebdfa524cbcdedb6