2 ms·
Often, an error state machine is better than error code passing. (along the result or separately) Such a design forces you to handle all errors near the place
by AstralStorm 10y ago
Often, an error state machine is better than error code passing. (along the result or separately)
Such a design forces you to handle all errors near the place they occurred without the syntactic overhead. (Threading problems are overrated. Easy to dodge by providing a Context attribute which then works like IO monad in Haskell.)
It essentially works like exceptions without a forced stack unwind and return - which may or may not be good. Both are easy to convert and interoperate.