diff --git a/poc/bin/kapow b/poc/bin/kapow index 3243ba1..f9073e7 100755 --- a/poc/bin/kapow +++ b/poc/bin/kapow @@ -185,6 +185,8 @@ async def get_field(request): content = await connection.get(field) except ValueError: return web.Response(status=400, reason="Invalid Resource Path") + except KeyError: + return web.Response(status=204, reason="Resource Item Not Found") if isinstance(content, StreamReader): response = web.StreamResponse(status=200, reason="OK") diff --git a/spec/test/features/data/handler/error_itemnotfound.feature b/spec/test/features/data/handler/error_itemnotfound.feature index 791538b..2f38076 100644 --- a/spec/test/features/data/handler/error_itemnotfound.feature +++ b/spec/test/features/data/handler/error_itemnotfound.feature @@ -1,3 +1,4 @@ +@wip Feature: Fail to retrieve nonexistent resource items in Kapow! server. If trying to access a nonexistent resource item then the server responds with a no content error. @@ -11,6 +12,6 @@ Feature: Fail to retrieve nonexistent resource items in Kapow! server. | method | url_pattern | | GET | /listRootDir | When I send a request to the testing route "/listRootDir" - And I get the resource "request/params/meloinvento" + And I get the resource "/request/params/meloinvento" Then I get 204 as response code And I get "Resource Item Not Found" as response reason phrase