getify / monio

The most powerful IO monad implementation in JS, possibly in any language!

Home Page:http://monio.run

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bug: IOx instances that throw exceptions are a mess

getify opened this issue · comments

The error handling story around IOx is embarrassingly buggy and insufficient.

  • exceptions during IOx effect running leave the instance in an inconsistent state where it can't be cleanly re-run
  • chaining an IOx runs it twice (once while registering the listener, then runs it directly)
  • registering an exception-throwing IOx as a dependency leaves the parent IOx in an inconsistent state
  • exceptions don't have any way to propagate from one IOx instance to another in a chain
  • etc etc etc

Need an onError(..) and offError(..) to register handlers to listen for exceptions in IOx instances, and need exception notifications to propagate down an IOx chain until it finds registered listener(s).