From 341df87c412a89723caa229bef298e9cab37a137 Mon Sep 17 00:00:00 2001 From: Flavio Percoco Date: Thu, 10 Sep 2015 17:19:16 +0200 Subject: [PATCH] Don't raise 404 on missing queues In versions 1.1 and v2 queues are treated as lazy resources. Therefore, the API should not be raising 404 errors when listing messages for non existing queues. Change-Id: I58480ebe71e85c2d5460526504e71184f1a5e003 --- zaqar/transport/wsgi/v1_1/messages.py | 4 ++-- zaqar/transport/wsgi/v2_0/messages.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/zaqar/transport/wsgi/v1_1/messages.py b/zaqar/transport/wsgi/v1_1/messages.py index 5782ac973..3d742ade8 100644 --- a/zaqar/transport/wsgi/v1_1/messages.py +++ b/zaqar/transport/wsgi/v1_1/messages.py @@ -111,9 +111,9 @@ class CollectionResource(object): LOG.debug(ex) raise wsgi_errors.HTTPBadRequestAPI(six.text_type(ex)) - except storage_errors.DoesNotExist as ex: + except storage_errors.QueueDoesNotExist as ex: LOG.debug(ex) - raise falcon.HTTPNotFound() + messages = None except Exception as ex: LOG.exception(ex) diff --git a/zaqar/transport/wsgi/v2_0/messages.py b/zaqar/transport/wsgi/v2_0/messages.py index 5782ac973..3d742ade8 100644 --- a/zaqar/transport/wsgi/v2_0/messages.py +++ b/zaqar/transport/wsgi/v2_0/messages.py @@ -111,9 +111,9 @@ class CollectionResource(object): LOG.debug(ex) raise wsgi_errors.HTTPBadRequestAPI(six.text_type(ex)) - except storage_errors.DoesNotExist as ex: + except storage_errors.QueueDoesNotExist as ex: LOG.debug(ex) - raise falcon.HTTPNotFound() + messages = None except Exception as ex: LOG.exception(ex)