Expose PHP errors with JavaScript events
adamziel opened this issue · 3 comments
Let's enable gathering PHP errors from Playground instances. This should be highly useful for monitoring any sort of live previews, and even for gathering error information from WordPress core itself.
Playground could surface PHP and JavaScript errors encountered by its users and become a great source of insights about WordPress stability
Playground could enable collecting not only stack traces and messages, but also:
- Environment info (browser, php version, WordPress version)
- The exact way WordPress was set up (which plugins, themes, which versions)
- The exact list of user interactions before the error was triggerred
This information would help solve WordPress core issues and alert plugin authors.
Technically, the API could be:
playground.addEventListner('request.end', function(response) {
// Inspect:
// response.exitCode
// response.errors
});The first phase of this is completed. PHP error logs are now visible in the browser console and we have a logger that can be used be Plaground.
PHP errors can be viewed in browser console, and there is now a way to catch crashes https://wordpress.github.io/wordpress-playground/contributing/crash-reports