Of course, I would have preferred if you had used the solutions to "Typed exception propagation" and "Finegrained error propagation" (SOLR-3382) to be found in the patch for SOLR-3178. Then there would be support for propagating typed exceptions across the wire and for such an exception to contain a list of success/exception per sub-operation (Core API operations in this case).
Then the response could be an actual typed exception with typed sub-exceptions for sub-operations that went wrong - e.g.
- shard1_replica1: CoreAlreadyExistsException
- shard1_replica2: "success"
- shard2_replica1: NoSpaceLeftOnDeviceException
- shard2_replica2: NoRouteToNodeException
Instead of exceptions always being SolrException and everything else is to be found out by inspecting text or parsed JSON/XML containing text-stuff only. No actual typed exceptions propagated and thrown at client-side.
In SOLR-3178 this those features returning typed exception with typed sub-exceptions (one for each sub-operation carried out unsuccessfully) is used around optimistic locking errors on multidocument update requests (where the update of some documents can go well, while update of other documents fail e.g. due to version problems), but the exception propagation and sub-exception system was intentionally designed general purpose, because it is obvious that there will be a lot of cases, in a distributed system like this, where an operation will result i several sub-operations, where each of those can fail/succeed independently, and where you would like to be able to provide the original client with a finegrained "result/report" back - an object/exception hierarchy to inspect and not a bunch of text to parse.
Of course, at serialized/transport level, the solution does not do anything SolrJ/Java-specific, because the client might not be SolrJ/Java, but if it is, exceptions with sub-exception are automatically created and thrown.
Just a FRIENDLY note/reminder that this category of "issues" already have a generic and powerful solution waiting to be used - in the great SOLR-3178 patch