From d46142b79573d7ec514e8c1613989629af7bbd48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20K=C3=B6gl?= Date: Wed, 24 Jul 2013 20:34:28 +0200 Subject: [PATCH] assert expected type of response from CouchDB --- couchdbkit/client.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/couchdbkit/client.py b/couchdbkit/client.py index 3a9c144..057f778 100644 --- a/couchdbkit/client.py +++ b/couchdbkit/client.py @@ -999,6 +999,9 @@ def fetch(self): self._dynamic_keys = [] self._result_cache = self.fetch_raw().json_body + assert isinstance(self._result_cache, dict), 'received an invalid ' \ + 'response of type %s: %s' % \ + (type(self._result_cache), repr(self._result_cache)) self._total_rows = self._result_cache.get('total_rows') self._offset = self._result_cache.get('offset', 0)