Fork me on GitHub
#cursive
<
2020-01-16
>
kenny03:01:54

I'm running the debugger and have a function like this:

(defn foo
  [x]
  (+ x "as"))
When I run (foo 1) in the repl I get a ClassCastException thrown. I have Java Exception Breakpoints > Any exception checked. And a notification for only Uncaught exceptions (the caught exception is unchecked). The debugger does not pause on the ClassCastException with this configuration. Is this expected?

cfleming04:01:25

No, that should work. If you switch to catching caught exceptions too does that stop?

kenny04:01:24

Yes. It also stops at a bunch of other places.

cfleming04:01:45

Hmm, that’s probably because the REPL will catch all exceptions to do error handling, and the debugger knows that.

cfleming04:01:00

Could you file an issue about that? I’m not sure I’ll be able to fix that but I’ll try.

kenny05:01:33

Ok. Will do tomorrow.

kenny22:01:01

Do people typically start their REPL in "debug" mode so you don't need to restart your REPL to activate it when you need it?

cfleming23:01:09

I don’t always start a REPL (depends what I’m working on, it’s not always possible/useful), but I always start my app in debug mode, yes.

cfleming23:01:11

There’s very little downside. The main problem is that I’ve found that it can greatly increase memory consumption on the launching IDE, but not always.

kenny23:01:54

I think I'll start doing that! I only found myself reaching for the debugger in dire situations because it required a REPL restart, having always started a REPL in "run" mode. For some reason I assumed there was some downside to starting in debug mode.

cfleming23:01:02

@potetm It took a while to get this right, but:

(iterate (fn [_] (throw (RuntimeException.))) 0)
Error printing return value at user/eval349$fn (NO_SOURCE_FILE:2).
null
(with the socket REPL)

aw_yeah 4