tealish icon indicating copy to clipboard operation
tealish copied to clipboard

Provide better error message (or more specific to situation) for evaluation order issues.

Open pbennett opened this issue 3 years ago • 2 comments

A statement like: if a == 2 && b ==3: will yield an error like: Error: Cannot parse "if a == 2 && b ==3" as Expression at line 100

I had a more involved if statement in my particular case but I fought for quite a bit of time trying to figure out what was wrong (and there's no examples in the repo of an && expression like above) until I realized it wanted if (a==2) && (b==3):

Tealish should make it extremely clear that the evaluation order isn't defined and needs to be. The error instead reads almost like a generic 'something's wrong' - ie: a syntax error.

pbennett avatar Jan 27 '23 21:01 pbennett

Yep, this is definitely an area that needs attention. I do want the errors to be very precise and useful but it will take a bit of work to get there. Definitely in the plan though.

fergalwalsh avatar Jan 30 '23 17:01 fergalwalsh

Somewhat related, but this goes for a number of issues. Errors with no line number information and stack traces with confusing exceptions.

ie: I had a block that was missing an end statement (I think it was commented out) and the error message was a stack trace wall

ending with the message: "AttributeError: 'NoneType' object has no attribute 'startswith'".

I'd think a missing end would be very easy to detect as it's basically a nested declaration of func/block, etc.

pbennett avatar Jan 30 '23 19:01 pbennett