2 ms·
One place where you are pretty much forced to use error objects is queue-based concurrency. In my case, a seperate thread listened for network events, parsed t
by yccs27 4y ago
One place where you are pretty much forced to use error objects is queue-based concurrency.
In my case, a seperate thread listened for network events, parsed them and put the results on a queue for the main thread to consume. For parsing errors, I needed to put error objects onto the queue instead of terminating the whole thread with an exception.
In this sense, error objects generalize much better to cases where you don't have an usual function-call structure.