-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Description
The friendly error system was first implemented at the p5.js contributors conference. It is an effort to provide more human readable and friendly error messages in console. It also does some minimal argument type checking since JS does not do this. The nice thing about it is that it is only added to the p5.js build of the library, and eliminated from p5.min.js to improve performance speed. However, there are a number of issues and extensions that are required before it's fully up and running.
I think the FEs would benefit from one person taking this on as a sort of concentrated project. It could be a good Processing Fellowship or Google Summer of Code project. For organization purposes, I am aggregating all the Friendly Error related issues here for now. I will close but link to all other issues. If someone were to tackle this project, the first step would be to read through all the issues and devise a roadmap and plan of attack.
- validateParameters can't support multiple-type parameter - for example, methods dealing with color often can take either a color object or a number as an argument. however, the
validateParameters()function doesn't support this. - Friendly Error Messaging for unsupported browsers - it would be nice to have messages that alert the user if they are trying to use functions of p5 that are not supported by their browser.
- Friendly Error Messaging should show sketch line number
- Generate Friendly Error Messaging from existing documentation - it would be nice to auto-generate the parameters accepted by each function from the reference, rather than having to manually add them to each function in the code.
These two pages describe some more thinking around it, currrent status, and future plans/ideas: