From 6212a53f6cc7cea01eb514afa696448d125b276f Mon Sep 17 00:00:00 2001 From: drebs Date: Fri, 29 Sep 2017 15:54:09 -0300 Subject: [bug] raise when trying to get flags of unexisting blob --- src/leap/soledad/client/_db/blobs.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/leap/soledad/client') diff --git a/src/leap/soledad/client/_db/blobs.py b/src/leap/soledad/client/_db/blobs.py index 31964a6c..6d47999a 100644 --- a/src/leap/soledad/client/_db/blobs.py +++ b/src/leap/soledad/client/_db/blobs.py @@ -58,6 +58,10 @@ class BlobAlreadyExistsError(SoledadError): pass +class BlobNotFoundError(SoledadError): + pass + + class InvalidFlagsError(SoledadError): pass @@ -375,8 +379,8 @@ class BlobManager(object): params.update({'only_flags': True}) response = yield self._client.get(uri, params=params) if response.code == 404: - logger.warn("Blob not found in server: %s" % blob_id) - defer.returnValue(None) + logger.error("Blob not found in server: %r" % blob_id) + raise BlobNotFoundError(blob_id) defer.returnValue((yield response.json())) @defer.inlineCallbacks -- cgit v1.2.3