p5.js icon indicating copy to clipboard operation
p5.js copied to clipboard

Replaced all console.error with p5._friendlyError

Open samrudh3125 opened this issue 1 year ago • 9 comments

Resolves #6630

Changes:

All the console.error in the codebase were replaced with p5._friendlyError. Since this is my first contribution kindly accept this.

Screenshots of the change:

Screenshot (34)

PR Checklist

samrudh3125 avatar Dec 30 '23 09:12 samrudh3125

🎉 Thanks for opening this pull request! Please check out our contributing guidelines if you haven't already. And be sure to add yourself to the list of contributors on the readme page!

welcome[bot] avatar Dec 30 '23 09:12 welcome[bot]

Since this is my first contribution i didnt exactly understand what is inline documentation and unit tests. Please accept the pull request as i have put a lot of time in this contribution

samrudh3125 avatar Dec 30 '23 09:12 samrudh3125

@all-contributors please add @samrudh3125 for THING(S)

samrudh3125 avatar Dec 30 '23 09:12 samrudh3125

@samrudh3125

I couldn't determine any contributions to add, did you specify any contributions? Please make sure to use valid contribution names.

allcontributors[bot] avatar Dec 30 '23 09:12 allcontributors[bot]

all-contributors please add @YOUR-USERNAME for p5.js

samrudh3125 avatar Dec 30 '23 11:12 samrudh3125

@all-contributors please add @samrudh3125 for processing/p5.js

samrudh3125 avatar Dec 30 '23 12:12 samrudh3125

@samrudh3125

I couldn't determine any contributions to add, did you specify any contributions? Please make sure to use valid contribution names.

allcontributors[bot] avatar Dec 30 '23 12:12 allcontributors[bot]

@all-contributors please add @samrudh3125 for a11y

samrudh3125 avatar Dec 30 '23 12:12 samrudh3125

@samrudh3125

I've put up a pull request to add @samrudh3125! :tada:

allcontributors[bot] avatar Dec 30 '23 12:12 allcontributors[bot]

Hey @samrudh3125, thanks a lot for your work on this. However, that's not exactly how it works. For example, when I use console.err(e), it means I’m unsure of what’s happening or what kind of error might be occurring, and we get a line from the p5.js library. Friendly errors, on the other hand, are designed to be more helpful to the user. They point out the specific line in your code where the issue happened and even suggest possible solutions. These errors are not only formatted clearly but also provide guidance. You can see an example below where both an error message and a friendly error message are shown.

Screenshot from 2024-10-02 09-06-02

So, closing this PR, but thanks a lot on your work.

perminder-17 avatar Oct 02 '24 03:10 perminder-17