elasticsearch/elasticsearch-py — pull request #10 by yohanboniface (2013-10-14 13:03:24+00:00)
Title: Raise ElasticsearchException when bulk_index returns an error

Hi,

I found myself with a `KeyError: 'ok'` after something like 3 millions document indexed, and I was a little bit disappointed. So it seems to me that a better error message and the ability to catch it worth the extra "if" statement.

What do you think?

Thanks!

Yohan

For the record, here is the JSON I get:
```
{'index': {'_type': 'place', '_id': 'IGNADRNIVX_0000000269162415', 'error': 'UnavailableShardsException[[osm][4] [2] shardIt, [0] active : Timeout waiting for [1m], request: org.elasticsearch.action.bulk.BulkShardRequest@504430b5]', '_index': 'osm'}}

```