chiasm-project / chiasm

A browser based environment for interactive data visualizations.
MIT License
184 stars 27 forks source link

Throw an error if a component fails to load #64

Open curran opened 8 years ago

curran commented 8 years ago

If a a plugin is referenced but not able to be resolved, Chiasm should throw an error (after a timeout of, say 5 seconds). This would be helpful for debugging.

FriendFX commented 8 years ago

Not quite sure if this is related, but I noticed that if the execution of a plugin's "constructor" fails (e.g. due to a reference error), the error gets caught at line 1460 of chiasm-v0.3.0.js (I think it is now line 254 in index.js) and even though it gets rejected there, it doesn't propagate to the top - there is no message in the console.

BTW, I am using Firefox 43.0.

Should I open a separate issue or is this the one you are talking about here?

curran commented 8 years ago

Thanks for this comment, it is very helpful. I have also observed this undesirable behavior and would like to fix it. I have been frustrated in several instances to find that errors expressed by rejecting promises do not bubble to the top. At first I was using native Promises, and I think all rejected promises bubbled to the top in the Chrome console. Perhaps this behavior of swallowing up promise rejections was introduced when I added the dependency on es6-promise when resolving issue #50 on browser compatibility.

Since the non-bubbling-up phenomenon is distinct from the issue described here, I have created a separate issue to track it #67.