Fork me on GitHub
#cider
<
2022-07-19
>
witek10:07:57

Hallo. I have a problem seeing exceptions when evaluating in buffer. I am connected to shadow-cljs with a runtime on Google Firebase Functions emulator. I can evaluate in REPL and in buffers. Here is an example: When I evaluate in the REPL, I get the following output: Execution error (TypeError) at (<cljs repl>:1). shadow.js.shim.module$twilio.default is not a function ;; => :repl/exception! Which is what I need. But when I evaluate in the buffer, I only see the result, which is :repl/exception and I can not see the error itself. Is there a way to make the error visible somewhere when I eval in buffer? Thank you!

thheller12:07:18

normally the full error is printed to the console, so it should be somewhere in the emulator logs?

thheller12:07:42

but cider seems the hide the error for some reason. someone else asked about this not too long ago

bozhidar13:07:21

It's more likely that it gets printed in the nREPL server buffer or something like this. CIDER definitely doesn't do anything to hide some of the error output that would normally end up the REPL. The output bindings can get messy.

witek13:07:35

How do I get access to the nREPL server buffer?

thheller14:07:08

@U2ERGD6UD FWIW the error above means that you probably used (require '["twilio$default" :as x]) or (require '["twilio" :default x]) or via ns and then (x ...) somewhere. but x wasn't actually a function.

thheller14:07:45

so in this case there isn't really more to this error it could show

witek14:07:29

@U05224H0W Thank you. I figured this out. But this was not the point of my question here. I have the problem with the missing exception contents all the time. Every time I eval something in a buffer and it fails, I have no idea what it is, because I only see :repl/exception , as output after the eval. Which is completely useless. I would like to see the error instead. The exception itself. But this is only visible when I evaluate in the CIDER-REPL.

witek14:07:47

So I think this is a CIDER problem. Because it shows the error when evaluating in CIDER-REPL, but swollows it, when evaluating in a buffer.

thheller14:07:29

sorry, don't know what CIDER-REPL is so can't comment on that front

witek14:07:42

I mean the REPL that CIDER provides after connected. It probably is just the emacs buffer which allows interaction with the REPL.

witek14:07:40

@U051BLM8F I tried to simplify the problem. I will try to explain: When I evaluate (println "hello") in the buffer, I get ==> nil as output in the buffer. And I can see hello printed into the REPL (in emacs). When I evaluate (throw (js/Error. "boom")) in the buffer, I get ==> :repl/error as output in the buffer. And NOTHING is printed into the REPL. But when I evaluate (throw (js/Error. "boom")) in the REPL, then the error IS printed into the REPL. So it seams a successful evaluation from a buffer "happens" in the REPL, while a failed evaluation does not.

bozhidar19:07:14

@U2ERGD6UD Can you file a ticket about this?

👍 1