Fork me on GitHub
#sci
<
2023-01-16
>
jeroenvandijk16:01:09

I have a test case that calls (/ 1 0) . I’m trying to print the error in a clean way. This doesn’t go well so far as sometimes I get an ExceptionInfo and sometimes I get an java.lang.ArithmeticException . So far I have not been able to reproduce this with a simple eval-string example, but looking at the code I think this has to do with Sci inlining (https://github.com/babashka/sci/issues/483). I wonder if can get access to the line and column of the caller consistently somehow

borkdude16:01:08

@jeroenvandijk repro + issue welcome

👍 2
jeroenvandijk17:01:57

I’m not able to find it yet. It seems to be hidden in a few layers of complexity. And it’s not consistent :man-shrugging:

jeroenvandijk17:01:05

I did find this

(sci/eval-string "[(require 'foo)]" ) ;=> java.lang.Exception
(sci/eval-string "(require 'foo)" ) ;=> clojure.lang.ExceptionInfo

jeroenvandijk17:01:31

Not sure if that’s expected or not. As you suggested to wrap things in a vector earlier