Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in except frame shows on wrong frame #341

Open
neilccbrown opened this issue Dec 3, 2024 · 1 comment
Open

Error in except frame shows on wrong frame #341

neilccbrown opened this issue Dec 3, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@neilccbrown
Copy link
Collaborator

Try putting this code into Strype (I forgot how the except clause works, you write "type as name" not just "name"):

try :
    raise Error 
except e:
    print("Error!") 

The console correctly prints:

< NameError: name 'e' is not defined >

You get an error indicator on the frame inside the try, although the error is really on the except:

strype_code_2024-12-03_11-11-36

And in the Javascript console:

[Vue warn]: Error in nextTick: "TypeError: errorElement is undefined"

found in

---> <Menu> at src/components/Menu.vue
       <Pane>
         <Splitpanes>
           <App> at src/App.vue
             <Root> vue.runtime.esm.js:619
TypeError: errorElement is undefined
    node_modules index.js:11425
    VueJS 5
    node_modules index.js:10910
    applyCb vue-composition-api.mjs:1372
    VueJS 12
    setContent tooltip.js:202
    updateContent popover.js:39
    mounted tooltip.js:135
    VueJS 5
    mounted tooltip.js:130
    VueJS 14
vue.runtime.esm.js:1897

which seems to arise from Menu.vue line 814 (as of 3rd December 2024):

if(isIdAFrameId(errorElement.id)){

Not sure if this is two bugs (wrong location, and issue with error navigation) or one bug.

@neilccbrown neilccbrown added the bug Something isn't working label Dec 3, 2024
@PwtKCL
Copy link
Collaborator

PwtKCL commented Dec 17, 2024

After investigation, I think this is a Skulpt bug as showing there:
image

Skulpt doesn't handle this well as 1) it shows the wrong location and 2) it doesn't point at the "Error" not being the actual issue.
Running the same code in Python shows:
image

While we can look for a fix in Skulpt, I wonder if there is a role TigerPython should play in the "except" format?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants