Fork me on GitHub
#clojure-dev
<
2019-09-14
>
matan11:09:55

Hey all, https://clojure.atlassian.net/browse/CLJ-2504 just caught my eyes, and I was wondering about the overall aspect of error messages, what you might recommend for 1) having errors sent over the wire to a tutor 2) overriding error texts that come from clojure and not directly from the underlying Java core (is there any code convention used across the language core, to be followed for meta-programming for overriding of error texts?)

matan11:09:06

Hope it's an okay question for the dev channel

lmergen18:09:50

The approach I might take in such a situation is to provide a library you need to require first. This library patches certain functions in the Clojure namespace to catch specific errors, and rethrows them as other errors.

lmergen18:09:26

These functions could be parts of the Clojure compiler.

lmergen18:09:37

It does require students to get at least far enough to require this library (this could be done implicitly in e.g. leiningen profiles), but it feels like a more “lispy” way of approaching the problem.