Any chance you have another example?
Could you share another example where accumulating errors makes sense?
A real life example: Asynchronous webservers usually have worker threads for I/O. I/O errors need to be routed to the originators of the I/O requests (which are in other threads). Exceptions cannot do that.
Here's the general point: Whether any given thing is an "Error" is highly subjective and context dependent. But clearly the error is data, so why take away the possibility to process it like any other data?
IMO, using exceptions doesn't preclude treating errors as data.
In your example with parallel processing, you could throw an error as exception, let it unwind the whole stack, catch it and return as the result of the task.
This way you don't couple the code that does the useful work with the code that handles errors.
In other words, I don't understand why you dislike exceptions.
IMO they are a good tool for any task that doesn't require different actions to handle different errors.
They introduce additional control paths which are hard to reason about. In many languages these are not even explicit. Exceptions require an additional syntax to handle them. And having exceptions requires significant language infrastructure and comes with a huge toll on the structure of software projects. See my topmost comment.
> In your example with parallel processing, you could throw an error as exception, let it unwind the whole stack, catch it and return as the result of the task.
Which would catch only the first encountered error per thread. And not catch all the other errors that we could encounter and report after that.
"And not catch all the other errors" I think, in most cases after an unexpected error happens it doesn't make sense to continue the task and report more errors, most likely induced by the first error.
Don't get me wrong, there are plenty of cases when returning errors as values is the best fit and using the exceptions would be a disaster, but my point is that, IMO, the situation when errors abort tasks and are handled in more or less the same way is much more common.
What is the point of sorting or grouping them?