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

Replace console.error with friendly error system #6630

Closed
3 of 17 tasks
shashank-iitbhu opened this issue Dec 13, 2023 · 9 comments
Closed
3 of 17 tasks

Replace console.error with friendly error system #6630

shashank-iitbhu opened this issue Dec 13, 2023 · 9 comments

Comments

@shashank-iitbhu
Copy link

Increasing Access

Many functions inside src/webgl and lib/addons currently uses console.error to report errors. It would be more user-friendly and consistent with the p5.js environment to replace these calls with the friendly error system (FES).

Most appropriate sub-area of p5.js?

  • Accessibility
  • Color
  • Core/Environment/Rendering
  • Data
  • DOM
  • Events
  • Image
  • IO
  • Math
  • Typography
  • Utilities
  • WebGL
  • Build Process
  • Unit Testing
  • Internalization
  • Friendly Errors
  • Other (specify if possible)

Feature enhancement details

For example, take parseASCIISTL function in webgl/loading.js,
I have triggered an error condition and the results,



with console.error:
Screenshot 2023-12-13 at 10 41 06 PM



with FES:
Screenshot 2023-12-13 at 10 42 01 PM
It would be more user-friendly and consistent with the p5.js environment to replace these calls with the friendly error system (FES).

Copy link

welcome bot commented Dec 13, 2023

Welcome! 👋 Thanks for opening your first issue here! And to ensure the community is able to respond to your issue, please make sure to fill out the inputs in the issue forms. Thank you!

@shashank-iitbhu
Copy link
Author

related PRs and Issues: #6098 and #5649 .

@shashank-iitbhu
Copy link
Author

@davepagurek if you can review this. I am willing to work on this issue. Please assign.

@ranjanmangla1
Copy link

can I get to work on this issue? this will be my first contribution in processing community

@omsharma29
Copy link

where to find this issue I forked the code base in local system??

@samrudh3125
Copy link

Do we also have to change the throw new error keywords or only the console.error

@samrudh3125
Copy link

@shashank-iitbhu please accept the pull request

@vaishnavi192
Copy link

@davepagurek Hey I would like to work on this issue. Can you assign me?

@perminder-17
Copy link
Contributor

Thanks for opening this issue. 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.

image

And also, when we are using console.error(maybe your error message) in your sketch, it probably mean we need to show it in an error format.

So, I need to close this issue.

@perminder-17 perminder-17 closed this as not planned Won't fix, can't repro, duplicate, stale Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment