Fork me on GitHub
#babashka
<
2020-08-22
>
borkdude10:08:59

Considering also adding locals to error report, suggested by someone on Twitter:

user=> (main/main "(defn foo [x y z] (/ x y z)) (foo 2 1 0)")
----- Error --------------------------------------------------------------------
java.lang.ArithmeticException: Divide by zero [at <expr>, line 1, column 19]

----- Context ------------------------------------------------------------------
1: (defn foo [x y z] (/ x y z)) (foo 2 1 0)
                     ^--- Divide by zero [at <expr>, line 1, column 19]

----- Locals -------------------------------------------------------------------
foo: [email protected]
x:   2
y:   1
z:   0

----- Stack trace --------------------------------------------------------------
clojure.core// - <built-in>
user/foo       - <expr>:1:19
user/foo       - <expr>:1:1
user           - <expr>:1:30

jkrasnay11:08:46

Wow, that’s awesome! Wish I could get that in Clojure/Java.