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

Stop future errors when encountering an async error #7563

Merged
merged 2 commits into from
Feb 18, 2025

Conversation

davepagurek
Copy link
Contributor

@davepagurek davepagurek commented Feb 18, 2025

Resolves #7533

Changes:

  • Introduces p5._error(), similar to p5._report, but that tries to stop all future errors from being logged
  • Creates a static p5.isPreloadSupported() function: if preload is not supported, an error will be logged if the user includes a preload function. This always returns false, but compatibility addons can override this.

Screenshots of the change:

image

Live: https://editor.p5js.org/davepagurek/sketches/jUcmPEi8c (also try uncommenting the preload addon script tag!)

PR Checklist

@davepagurek davepagurek marked this pull request as ready for review February 18, 2025 22:28
@davepagurek
Copy link
Contributor Author

I also updated the preload addon to go along with these changes, it's included in the test sketch in the description and can be uncommented.

@ksen0 @limzykenneth I'm going to merge this in, and then I think we're good for another release. (Do we also want to publish the compatibility addons to npm as a beta release too?)

@davepagurek davepagurek merged commit 23ce4fb into dev-2.0 Feb 18, 2025
2 checks passed
@davepagurek davepagurek deleted the stop-on-async-error branch February 18, 2025 22:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant