Railway Oriented Programming
What works even better is using dataflow instead of call&#x2F;return, as the problem largely goes away by itself.<p>With call&#x2F;return, you have to return something, so if you have nothing to return because of an error, you have to return that, or both the error and the normal return value (Go).  This pollutes the happy path.  With this polymorphic container through which you thread the remainder of the processing, you make the problem a little nicer, but it is still there.<p>With dataflow, you simply don&#x27;t send anything to the next filter stage, so your happy path is completely unaffected.  You then send the error to some kind of standard error output, which can often be centralised for your application.<p>Sounds to good to be true, but used it in Wunderlist, for example, and it worked like a charm.<p>Oh, and the same technique that works for when you don&#x27;t have a value (errors) works the same when you don&#x27;t have a value <i>yet</i> (async).