hpython icon indicating copy to clipboard operation
hpython copied to clipboard

Error explainer

Open LightAndLight opened this issue 7 years ago • 0 comments

Currently if you validate python code then you just get a list of errors. It would be good to be able to translate that list into a human readable representation. The output would give a succinct explanation of the error, and use the original source file + the annotations in the error to pull out relevant areas of the code so we can pinpoint the bits that caused the error.

For example, if we validate this code:

def a():
    x = 1
    y = x + b
    return y

we could get an error message like:

Line 3: 'b' is not in scope
2 |     x = 1
3 |     y = x + b
                ^
4 |     return y

LightAndLight avatar Dec 12 '18 01:12 LightAndLight