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?
@souenzzo so you aren't getting a stack trace or anything?
No, just a single-line msg in my stderr
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
are you using http://netty-socket.io?
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
ah
actually you must be using the Xi editor
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
https://github.com/xi-editor/xi-editor/blob/master/rust/rpc/src/parse.rs#L135
anyway, it looks you have two errors jammed together:
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
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
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=>
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.