histrio/py-couchdb

get_attachment raise no error

dedalus2000 opened this issue · 2 comments

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

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

Fixed in the last commits.
Thanks.