Wrong exception when get item from nonexistent table

Bug #1306561 reported by Oleksandr Minakov
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MagnetoDB
Fix Released
Medium
Oleksandr Minakov

Bug Description

Request:
POST http://127.0.0.1:8480/v1/default_tenant/data/tables/nonexistenttable/get_item

Request Headers:
{'Content-Type': 'application/json', 'Accept': 'application/json'}

Request Body:
{"consistent_read": true, "attributes_to_get": ["last_posted_by"], "key": {"forum": {"S": "forum1"}, "subject": {"S": "subject2"}}}

Response Status: 500

Response Headers:
{'date': 'Fri, 11 Apr 2014 11:54:09 GMT', 'content-length': '269', 'content-type': 'application/json'}

Response Body:
{"explanation": "The server has either erred or is incapable of performing the requested operation.", "code": 500, "error": {"message": "'NoneType' object has no attribute 'internal_name'", "traceback": null, "type": "AttributeError"}, "title": "Internal Server Error"}

Expected response status: 404

Expected response body:

{
    "explanation": "The resource could not be found."
    "code": 404
    "error":
       {
          "message": "Table 'nonexistenttable' does not exists",
          "traceback": null,
          "type": "TableNotExistsException"
      }
}

summary: - Wrong exception when get item from table with name ''
+ Wrong exception when get item from nonexistent table
Changed in magnetodb:
milestone: none → 2.0.3
importance: Undecided → Medium
description: updated
Changed in magnetodb:
assignee: nobody → Oleksandr Minakov (oleksandr-minakov)
Changed in magnetodb:
status: New → In Progress
description: updated
Revision history for this message
Openstack Gerrit (openstack-gerrit) wrote : Fix proposed to magnetodb (master)

Fix proposed to branch: master
Review: https://review.openstack.org/90705

Changed in magnetodb:
milestone: 2.0.3 → 2.0.4
Revision history for this message
Openstack Gerrit (openstack-gerrit) wrote : Fix merged to magnetodb (master)

Reviewed: https://review.openstack.org/90705
Committed: https://git.openstack.org/cgit/stackforge/magnetodb/commit/?id=bc387119b2256cc8c19a3332d6b758b29b32f5a3
Submitter: Jenkins
Branch: master

commit bc387119b2256cc8c19a3332d6b758b29b32f5a3
Author: Oleksandr Minakov <email address hidden>
Date: Mon Apr 28 15:05:37 2014 +0300

    Add check before get item

    Add check for the existence of the table before get item.
    Add unit test for coverage TableNotExistsException.

    Change-Id: I788d7d5116537e45e01d668a3a24c351d882e093
    Closes-Bug: #1306561

Changed in magnetodb:
status: In Progress → Fix Committed
Changed in magnetodb:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.