histrio / py-couchdb

Modern pure python CouchDB Client.
https://pycouchdb.readthedocs.org/
Other
120 stars 43 forks source link

raising HTTPError added to indicate missing credentials #3

Closed tpltnt closed 11 years ago

tpltnt commented 11 years ago

Hi niwibe,

if you create a database object without providing proper credentials, querying fails with a rather non-descriptive

File "/usr/lib/python3.3/site-packages/pycouchdb/client.py", line 448, in _query for row in utils.as_json(r)["rows"]: KeyError: 'rows'

This patch raises a HTTPError, if couchdb replies with a non 2XX status code. Cheers, tpltnt

niwinz commented 11 years ago

Sounds good!

Thanks!