Fork me on GitHub

What would CIDER do? (A question I often ask, when hacking on Calva). Right now I don't have Emacs handy, though, so here goes. What does CIDER do when you evaluate to comment and an error is thrown?


;; => is what I get 😐


When running M-x cider-pprint-eval-last-sexp-to-comment on (throw (ex-info "foo" {}))


Thanks! It is sort of true. But I think I'll try to include some little more info. 😃


Yes it is… I also get the *cider-error* buffer pop up — not sure if configuring it differently would change the behaviour though


I'm looking at how to support the Design Journal that @jr0cket mentioned in the ClojureScript podcast better. Then it makes sense to include some of the error message in the comment, me thinks.

❤️ 4

@rickmoynihan That’s definitely a bug. 🙂 It’d be nice if you reported it. I think nothing should be printed in the comment at all in such cases and users should just get the error buffer.


> I think nothing should be printed in the comment at all in such cases and users should just get the error buffer. That's what Calva does today. 😀 But it makes a boring design journal.


I’ve got no issues with boring. Printing the condensed error message is always an option, but it seems pointless to me if you get a stacktrace buffer alongside anyways.


It is in the design journal context that I think it is not pointless:


I will sometimes copy the most interesting part of an error message to a comment under the expressions


Especially of it's a useful learning experience or a common error the team experiences


somewhat related, but I'd actually like it if there was an option to display error messages in the result overlay without popping up an error buffer


90% of the time it's a simple typo and I don't need to see the entire stacktrace and spend half a second dismissing the popup window


@qythium what you ask for is what I use clj-kondo for, it picks up typos and many other errors and warnings. It works as a backend to flycheck


Yeah, I use flycheck-clj-kondo also, but it doesn't pick up on everything (eg. "typos" where I pass arguments in the wrong order)


just hacked together a prototype to try out over the next few days and see if it's a good idea 🙂


@qythium I like the idea. Feel free to send a PR.


I guess the only thing we need to consider is how to summon the stacktrace buffer in those cases, as I assume we won’t be showing it if we are relying on the overlay to communicate the error.