This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-02-19
Channels
- # announcements (1)
- # architecture (8)
- # babashka (8)
- # beginners (68)
- # biff (1)
- # calva (2)
- # clj-kondo (13)
- # cljs-dev (2)
- # clojure (71)
- # clojure-art (26)
- # clojure-europe (14)
- # clojure-nl (10)
- # clojure-uk (4)
- # clojurescript (96)
- # community-development (6)
- # conjure (1)
- # datalog (2)
- # emacs (6)
- # fulcro (20)
- # hugsql (7)
- # lsp (6)
- # nextjournal (13)
- # off-topic (7)
- # portal (1)
- # reagent (3)
- # reveal (8)
- # sci (50)
- # shadow-cljs (8)
- # spacemacs (2)
- # tools-deps (9)
- # xtdb (6)
I'd like to use a sticker to show me https://github.com/fulcrologic/guardrails log errors. They look like this and come up during runtime:
user=> (f 3.2)
ERROR /Users/user/project/src/com/domain/app_ns.clj:12 f's argument list
-- Spec failed --------------------
[3.2]
^^^
should satisfy
int?
or
string?
-- Relevant specs -------
:user/thing:
(clojure.spec.alpha/or :i clojure.core/int? :s clojure.core/string?)
This https://github.com/fulcrologic/guardrails/blob/920a372e86063a255b5036b4d07303f87024bb9e/src/main/com/fulcrologic/guardrails/core.cljc#L87 is responsible for handling errors and ultimately delegates error printing to utils/report-problem
, which just calls (.println message-str)
.
I can't quite figure out how to set up the sticker. I understand that stickers are typically applied to ref types, but is it possible to use with a simple function as a sort of watch? Any tips?Yes, there is, but I much prefer the string representation show above over the usual Spec error description in data. The tap would be good enough, but I am curious if I can use Reveal to keep an eye out on some formatted string output. As an aside, I'm a new Reveal user. Liking it very much so far. Thanks for the awesome tool!
👍 1