[#256] Fix exception message

* Typo: Scrol -> Scroll
* We need to format the string with the args ourselves (ScanError won't
  do it).
  Otherwise the args in the ScanError won't be substituted.
This commit is contained in:
Sujay Mansingh
2015-07-31 14:14:36 +01:00
committed by Honza Král
parent 3cb77ff0fb
commit e3d25e8fe3
+3 -3
View File
@@ -275,13 +275,13 @@ def scan(client, query=None, scroll='5m', raise_on_error=True, preserve_order=Fa
# check if we have any errrors
if resp["_shards"]["failed"]:
logger.warning(
'Scrol request has failed on %d shards out of %d.',
'Scroll request has failed on %d shards out of %d.',
resp['_shards']['failed'], resp['_shards']['total']
)
if raise_on_error:
raise ScanError(
'Scrol request has failed on %d shards out of %d.',
resp['_shards']['failed'], resp['_shards']['total']
'Scroll request has failed on %d shards out of %d.' %
(resp['_shards']['failed'], resp['_shards']['total'])
)
scroll_id = resp.get('_scroll_id')