WoofJS icon indicating copy to clipboard operation
WoofJS copied to clipboard

Make all error messages understandable

Open stevekrouse opened this issue 8 years ago • 2 comments

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:

  1. Syntax / parse error

  2. 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.

stevekrouse avatar Sep 08 '17 20:09 stevekrouse

I'm going to start working on this issue, hoping we can get some quickish improvements going.

madduccino avatar Jun 15 '19 13:06 madduccino

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/

stevekrouse avatar Jun 17 '19 13:06 stevekrouse