Make all error messages understandable
With both kinds of error messages, often they seem to make no sense. I wonder what it would look like if we tried to make every time of error message understandable. Obviously, there may be some that we can't fix much, but I think we could probably improve most or many of them.
There are two different types of WoofJS error messages:
-
Syntax / parse error
-
Runtime errors
For (1), we'd look at the different types of errors the Babel parser emits. For (2) we look at all the possible (or common) JS runtime errors.
I'm going to start working on this issue, hoping we can get some quickish improvements going.
Great! I think a good place to start would be proposing different kinds of errors to tackle first.
For example we discussed looking for the times when the JS runtime gives us a bad error message (at the top of the screen) but jslint gives us a good one (in the code editor gutter), and vice-a-versa, and how we should recognize when this happens and overwrite the bad errors with good ones.
More specifically, we also discussed unterminated delimiters, such as parens, quotes, brackets, etc, as well as missing commas.
We could also take a closer look at what the first few Woof projects require, and the common mistakes students make while doing them.
Something that might be helpful is this library, which among other things, makes better error messages for JS: http://aetherjs.com/. Maybe this would help too: https://jshint.com/