bikeshaving / crank

The Just JavaScript Framework
https://crank.js.org
MIT License
2.69k stars 76 forks source link

Better error handling #223

Closed brainkim closed 8 months ago

brainkim commented 2 years ago

One thing that annoys/worries me is that Crank seems to unrender everything when a runtime error is thrown during component execution. The sucky thing is that once we throw an error from a generator function, the function exits, so unlike other frameworks where components are just functions that get executed all the time, there isn’t really a nice way to recover.

At the very least, I want components to error gracefully, so the last valid render is shown. We could also consider logic to restart generator functions somehow, though this could be problematic, leading to weird infinite loops or swallowed errors which developers don’t notice.

brainkim commented 8 months ago

Closing as too vague! Will fill in with specific error examples soon.