Hmm... That is where I was confused a little bit. The following is what's on the wiki page:
Evaluation error at clojure.lang.Numbers.divide (Numbers.java:163). __ArithmeticException__ Divide by zero
which does have the Java exception class name in it, which is different from what's in the screenshot you posted on Twitter, which doesn't.
Since these error messages are meant for human beings (instead of machines/tools), I personally think that Java exception class names are irrelevant in all of the categories of errors messages since the only two things I, as a human being, would like to know about an error are:
What is wrong?
Where is it?
So in this case I referenced, the specific error message "Divide by zero" already helps me answer question 1) so I don't see the value of the more generic exception class name (ArithmeticException) in this particular error message.
In general, I would personally prefer not to see anything Java-related (including Java exception class names) in Clojure error messages (the presence of Java-related stuff is, in my opinion, simply a leak of abstraction.) This is especially helpful for Clojure(Script) beginners who don't have any Java background, yet. I know this is difficult to achieve sometimes (e.g., java.lang.Long) and not in the scope of this particular effort but this would, IMHO, be the right direction in terms of improving error messages in general.
Anyway, it's exciting to see the core team responding to community feedback and addressing this particular issue. This is, for me, "the next big thing" in Clojure. Thank you very much!
Oh, I may have a bug in the impl then - for evaluation errors, you should see the Java exception class in the message. Because these will flow out in Java interop and other cases there is often meaningful information in the cause exception class name (like ClassCastException), so the intent is that it will be there.
It is not a goal to remove Java-related stuff from the exception message. Clojure is a hosted language, embraces the host, and does not try to hide that fact. (It is a goal to remove stuff that's not useful, which may be either Java stuff or Clojure stuff.)
Thank you for the explanation. I totally overlooked the cases where java.lang.Throwable.getMessage may return null and exception class names would be the only meaningful things in those cases.
1
u/alexdmiller Aug 11 '18
Note that the Java exception names are still there for evaluation time errors but i had a hard time seeing value in them for other types.