You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
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?
The text was updated successfully, but these errors were encountered:
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 atry/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 thedraw()
function. When writing something likenostroke()
, it wouldn't trigger thetry/catch
, but instead report directly to the console (*** replacing non-relevant info):Once I added
p5.disableFriendlyErrors = true;
, then thetry/catch
worked, displaying the visible message within the website: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 atry/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?The text was updated successfully, but these errors were encountered: