Permalink
Browse files

some improvements to the cloud client

  • Loading branch information...
1 parent 574d1da commit 97e164e6e6c817fffd0ea63d5689c82c7acda398 @jamesturk committed Apr 14, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 oyster/ext/cloudsearch.py
@@ -21,6 +21,7 @@ def __init__(self, name, domainid, flush_every=None):
def flush(self):
+ print 'flushing!'
if self._current_batch:
payload = '[{0}]'.format(','.join(self._current_batch))
resp = requests.post(self.doc_url, payload,
@@ -29,7 +30,7 @@ def flush(self):
self._current_size = 0
if resp.status_code >= 400:
# http://docs.amazonwebservices.com/cloudsearch/latest/developerguide/DocumentsBatch.html
- print resp.status_code, resp.text
+ raise Exception('{0}: {1}'.format(resp.status_code, resp.text))
def add_document(self, id, **kwargs):
newdoc = {'type': 'add', 'version': 1, 'lang': 'en',

0 comments on commit 97e164e

Please sign in to comment.