histrio / py-couchdb

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

get_attachment raise no error #17

Closed dedalus2000 closed 11 years ago

dedalus2000 commented 11 years ago

With the wrong filename get_attachment doesn't raise any error (but gives an str with the json of the error)

dedalus2000 commented 11 years ago

client.py:

def get_attachment(self, doc, filename): .. r = self.resource(doc['_id']).get(filename, stream=False) ++ if r.status_code == 404: ++ raise NotFound("filename {0} not found".format(filename)) return r.content

niwinz commented 11 years ago

Fixed in the last commits. Thanks.