Fork me on GitHub
#core-async
<
2021-01-05
>
souenzzo00:01:50

Hello I'm getting a wired Error handling response - class java.lang.StringIndexOutOfBoundsException: start 95, end 92, length 115 It happens SOMETIMES (~10%) when I run a deftest. Inside this deftest has a async/thread. Looking at visualVM I have a stable count of 19 threads. There is no new dead/respawn threads then it occurs (looking just at visualvm graphs) I addeded an uncaught-exceptions-handler as in https://stuartsierra.com/2015/05/27/clojure-uncaught-exceptions But looks like that it has no effect. How can I debug this?

noisesmith00:01:48

@souenzzo so you aren't getting a stack trace or anything?

souenzzo00:01:12

No, just a single-line msg in my stderr

noisesmith00:01:00

my first instinct would be to wrap the body of the async/thread in (try ... (catch Exception e (println e))) - that will show the clojure print value for the exception including the stack

hiredman00:01:21

this is sort of out of left field, and I only jumped on it because that vaguely reminds me of a unicode decoding bug in that

hiredman00:01:45

actually you must be using the Xi editor

hiredman00:01:23

that error is from the editor, not from clojure, it is sending some code to clojure to run, and getting back the exception instead of what it expects

hiredman00:01:15

anyway, it looks you have two errors jammed together:

hiredman00:01:03

1. you have a client and server (client is the editor, server is the language server or repl or whatever) 2. the client is sending a command or some code to the server 3. the server is throwing an error, the string out of bounds exception 4. the server is reporting the error to the client as something like (str ex) 5. the client on getting the class java.lang.StringIndexOutOfBoundsException: start 95, end 92, length 115 is reporting the error to you

hiredman00:01:57

so "class java.lang.StringIndexOutOfBoundsException: start 95, end 92, length 11" is the error being generated on the server and "Error handling response -" is something the client is tacking on to the front of it

hiredman00:01:23

user=> (subs "" 0 1)
Execution error (StringIndexOutOfBoundsException) at java.lang.String/checkBoundsBeginEnd (String.java:3734).
begin 0, end 1, length 0
user=> (str *e)
"java.lang.StringIndexOutOfBoundsException: begin 0, end 1, length 0"
user=>

souenzzo01:01:30

Thnk you all. I think that it's something with middlewares and somehow related to midje report. It only occur when #midje fact try to report an error !!?? I'm OK with it. I will not debug anymore. Sorry and thanks. I'm sure that I learned new things with these comments.