toolness / p5.js-widget

A reusable widget for embedding editable p5 sketches in web pages.
https://toolness.github.io/p5.js-widget/
GNU Lesser General Public License v2.1
161 stars 44 forks source link

Errors from loadJSON aren't shown to user #46

Closed toolness closed 8 years ago

toolness commented 8 years ago

I just noticed that if loadJSON() fails due to e.g. a CORS error, the user isn't informed in any way. They should be!

This might actually involve making changes to p5.js itself, or monkeypatching p5 at runtime to behave differently. Looking at the source code, it appears loadJSON just logs the XHR's statusText on failure if an error occurs and an explicit error callback wasn't provided to loadJSON--and in Chrome's case at least, statusText is just an empty string!

toolness commented 8 years ago

This is a duplicate of https://github.com/processing/p5.js/issues/1501.