EOSIO / demux-js

💫 Deterministic event-sourced state and side effect handling for blockchain applications
MIT License
307 stars 71 forks source link

BaseActionWatcher.watch should provide a way to handle error #181

Open tiendq opened 4 years ago

tiendq commented 4 years ago

Currently method BaseActionWatcher.watch catches errors in an internal try/catch block and silently swallow the errors. It stops watching on any error without providing any chance to retry. It returns undefined in all cases :O, and all state properties are private so there's no way to handle errors from derived classes.

tiendq commented 4 years ago

It should be a class design bug, not an enhancement. Because whenever a network error happens for example, client app (which using demux) knows nothing and can do nothing even if it wants to restart.