fix(data): replace raw console logs with FES in TypedDict (#8607)#8616
Open
gourijain029-del wants to merge 1 commit intoprocessing:mainfrom
Open
fix(data): replace raw console logs with FES in TypedDict (#8607)#8616gourijain029-del wants to merge 1 commit intoprocessing:mainfrom
gourijain029-del wants to merge 1 commit intoprocessing:mainfrom
Conversation
…#8607) Refactored validation checks across get, set, create, and NumberDict math methods to use p5._friendlyError() instead of console.log(). This ensures the errors are translatable via i18n and can be suppressed when p5.disableFriendlyErrors is true.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
1. Changes you have made
Replaced 6 instances of raw
console.log()outputs withp5._friendlyError()across the Dictionary classes in src/data/p5.TypedDict.js. This ensures that validation error messages regarding nonexistent keys, invalid dictionary creation parameters, and unsupported key/value types are properly suppressible and formatted by the Friendly Error System.(Note: As requested in the issue, the intentional
console.logoutput inside the.print()method was left alone.)2. Which issue this PR fixes
Fixes #8607
3. Steps to test changes
p5.disableFriendlyErrors = true;..get(),.div(), or.add()on a key that you haven't added to the dictionary yet.p5.disableFriendlyErrors = false;(the default).p5._friendlyErrorproperly logs the warning.