error-message-catalog

shaunlebron 2016-04-26T14:48:51.000008Z

Hi Henry, …

We found a repo with an exceptions directory containing binary files that I think you guys built:
<https://github.com/Clojure-Intro-Course/clojure-intro-class>

Maybe you can provide some context on this so Dmitri can make use of your data?

shaunlebron 2016-04-26T14:49:14.000009Z

From Henry:

shaunlebron 2016-04-26T14:49:26.000010Z

A quick refresher suggests that src/errors is the best directory for poking around. We deliberately avoided exactly matching errors, but error_dictionary.clj {Categories of errors}, dictionaries.clj {stracktrace type translations} and error_hints.clj {Suggestions based on the type of error} are useful to skim through. 

Running our code might be informative, but I apparently left that information out of the readme. If you want to see our version of an error, put an entire section of erroneous code in src/intro/may2015.clj (name is for historic reasons). You can also grab the exception object by serializing it (&amp; etc) and then feeding it to errors.prettify_exception/prettify-exception.

shaunlebron 2016-04-26T15:10:31.000011Z

This is really impressive stuff

shaunlebron 2016-04-26T15:10:41.000012Z

Just looked at it

shaunlebron 2016-04-26T15:11:41.000013Z

They have catalogued 51 error patterns with regex, and do auto-translation into clearer messages

shaunlebron 2016-04-26T15:12:30.000014Z

If there’s one file you look at it, it should be this: https://github.com/Clojure-Intro-Course/clojure-intro-class/blob/master/src/errors/error_dictionary.clj

shaunlebron 2016-04-26T15:29:41.000016Z

https://twitter.com/shaunlebron/status/724983642456354816

cfleming 2016-04-26T23:22:11.000018Z

I’ve been planning for a while to allow users to fix errors using their technique in the Cursive REPL.

cfleming 2016-04-26T23:22:22.000019Z

Cursive could do it using code folding on the client side.

cfleming 2016-04-26T23:23:27.000020Z

Since the REPL is actually pretty non-extensible when it comes to error handling, I’ll probably wrap all forms I send in a try/catch and then post-process any exceptions. Pretty much any exception coming from the compiler doesn’t need a stacktrace, they’re completely useless and quite scary.

cfleming 2016-04-26T23:26:35.000021Z

I’d also like to try some kind of pattern matching on an error database to see if a more useful description could be provided to the user.