toastdriven/pysolr — pull request #114 by rouge8 (2014-03-20 22:44:12+00:00)
Title: Add details about the response to exceptions when Solr doesn't return HTTP 200

pysolr right now gives only very minimal information in the exceptions it raises from a failed Solr request, especially, if as is the case without #113, it can't extract the Solr error message.

This introduces a `SolrHttpError` exception for these cases and include the `status_code`, `content`, and `headers` of the response on the raised Exception. All that I need personally is the status code and content, but I threw the headers in too for sake of completeness, but I'm open to making changes.

Our use case for this is responding differently to the end-user based on the status code and content. If it's a 400, it means we can give them feedback about their query, if it's a 503, the search service is unavailable, etc.