From e3d25e8fe3827b3544e0436bf752a1369e5979eb Mon Sep 17 00:00:00 2001 From: Sujay Mansingh Date: Fri, 31 Jul 2015 14:14:36 +0100 Subject: [PATCH] [#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. --- elasticsearch/helpers/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/elasticsearch/helpers/__init__.py b/elasticsearch/helpers/__init__.py index c1fc81bd..526a3a6e 100644 --- a/elasticsearch/helpers/__init__.py +++ b/elasticsearch/helpers/__init__.py @@ -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')