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

FES system stops try/catch flow? #6526

Closed
ffd8 opened this issue Nov 3, 2023 · 1 comment
Closed

FES system stops try/catch flow? #6526

ffd8 opened this issue Nov 3, 2023 · 1 comment

Comments

@ffd8
Copy link
Contributor

ffd8 commented Nov 3, 2023

Topic

I'm testing the waters of some experimental live-coding with p5 + additional frameworks, which means running blocks of code through an eval() pipe to an iframe. When someone has an error, it's easily caught via a try/catch, which keeps the code from compiling and the visuals running. Until I realized that this wasn't the case while typing a bug within the draw() function. When writing something like nostroke(), it wouldn't trigger the try/catch, but instead report directly to the console (*** replacing non-relevant info):

Uncaught ReferenceError: nostroke is not defined
    at draw (eval at ******* (*******/:761:23), <anonymous>:3:2)
    at e.default.redraw (p5.min.js:2:542441)
    at _draw (p5.min.js:2:462354)

Once I added p5.disableFriendlyErrors = true;, then the try/catch worked, displaying the visible message within the website:
image

FES is awesome and its relevant messages are always helpful, however it made me wonder if it should/could both give the FES reply aaand allow an error to carry on triggering a catch statement?? Is this already the case and I simply have to use a try/catch differently or customize something in my usage of p5? At the moment, it seems necessary to disable FES in order to give visual feedback (in window rather than JS console) that there's a problem with the code...

*edit, I'm using p5.min.js, which means that maybe FES is already disabled? Likely means it's my own issue.. or is it possible some aspect of the FES error catching is still present in the min version?

@ffd8 ffd8 added the Discussion label Nov 3, 2023
@ffd8
Copy link
Contributor Author

ffd8 commented Nov 3, 2023

Hmm since FES is disabled – this has nothing to do with p5.. seems to be an issue with my own eval + iframe setup.

@ffd8 ffd8 closed this as completed Nov 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant