hedyorg / hedy

Hedy is a gradual programming language to teach children programming. Gradual languages use different language levels, where each level adds new concepts and syntactic complexity. At the end of the Hedy level sequence, kids master a subset of syntactically valid Python.
https://www.hedy.org
European Union Public License 1.2
1.27k stars 282 forks source link

[UI idea] Catch Skulp runtime errors #4770

Open Felienne opened 7 months ago

Felienne commented 7 months ago

Also while working on https://github.com/hedyorg/hedy/pull/4677 I noticed again we have ugly error messages of Python leaking out:

image

Why don't we add a catch all on the front-end and show the "you write a program we were not expecting" error that we alreayd have for hard back-end errors.

It surely looks nicer! (Although it will make debugging harder for us, that's ok)

I suspect this is easy to do for a front-ender (like @jpelay or @hasan-sh?).

jpelay commented 7 months ago

Hi! That's a great idea. I think since I have prior experience with Skulpt I might take this one.

boryanagoncharenko commented 3 months ago

Just want to point out that during the previous contributors meeting we were discussing this issue and @hasan-sh expressed interest in picking it up.

It seems that now the code sample produces a nice error but I was able to find another program with a leaking error (logged as #5322):

time is 10
forward time
hasan-sh commented 3 months ago

Just want to point out that during the previous contributors meeting we were discussing this issue and @hasan-sh expressed interest in picking it up.

It seems that now the code sample produces a nice error but I was able to find another program with a leaking error (logged as #5322):

time is 10
forward time

True Boryana, i remember having an idea that'd possibly be the solution. That is, we could add a wrapper for errors (error boundary component!) where we catch all sorts of errors and perhaps only show a generic message when a "python error" is returned from the backend. I'm not sure about the validity of this proposal, but i guess it'd be nice to work with skulpt and find out?! :)