r/Clojure • • Aug 11 '18

Error message improvements in Clojure 1.10

https://mobile.twitter.com/puredanger/status/1028103654241443840
89 Upvotes

41 comments sorted by

View all comments

Show parent comments

1

u/alexdmiller Aug 11 '18

No plans, and I think locking stuff like that in codes is actually antithetical to Clojure's philosophy of making things amenable to evolution.

2

u/Eno6ohng Aug 11 '18

Hmm, I don't think I understand, sorry.

What I meant by "fits clojure's philosophy" is the fact that

  • it decouples human-readable message from the specific type and info about the error (e.g. instead of string "ClassCastException: can't cast from X to Y" that'd be edn: {:type :clojure.errors/cast, :from X, :to Y} - something like that);

  • it allows to add new errors and change the reporting format without introducing breaking changes (growth, not breakage).

You mean that errors should not be a part of the contract, so they can change and evolve and be not locked up by backwards compatibility?

2

u/alexdmiller Aug 11 '18

You mean that errors should not be a part of the contract, so they can change and evolve and be not locked up by backwards compatibility?

That. Trying to catalog the universe of possible Clojure errors and maintain that with compatibility over time does not seem like a good use of anyone's time. I think it's a dubious claim that this would actually be useful to tools or as an entry to alternate docs either.

3

u/Eno6ohng Aug 12 '18

Well, I would disagree (errors always were the main complaint + maria.cloud does a great job at improving the experience, but the approach they took could only get us so far; clojuredocs for errors (with examples etc) would be awesome imo), but I can definitely see your point. Thanks!