Description
We found this problem while upgrading Solr from 4.4 to 4.10.3. Our integration test is similar to this Solr unit test,
Specifically we test if the Solr server returns BAD_REQUEST when provided with incorrect input.The only difference is that it uses CloudSolrServer instead of HttpSolrServer. The CloudSolrServer always returns SERVER_ERROR error code. Please take a look
I think we can improve the error handling by checking if the first exception in the list is of type SolrException and if that is the case return the error code associated with that exception. If the first exception is not of type SolrException, then we can return SERVER_ERROR code.