rhec/pyelasticsearch — pull request #116 by konradkonrad (2013-07-12 12:30:55+00:00)
Title: Fix broken error handling

The code from _raise_exception expected a string here, which e.g.
for FetchPhaseExecutionException is not the case and yields an
"AttributeError: 'dict' object has no attribute 'startswith'".

In such a case the exact error_messages would be in response body in
[shard['reason'] for shard in response_body['_shards']['failures']].

This checks for a string and just returns the whole response_body
otherwise, so the elasticsearch exception becomes visible to the
user.