Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When getting from a table that doesn't exist boto raises an exception. I think we should handle this and return none #3

Open
rmetcalf9 opened this issue Feb 7, 2020 · 0 comments

Comments

@rmetcalf9
Copy link
Owner

response = self.objectStore.getTable(objectType).get_item(

Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/flask/app.py", line 1813, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/lib/python3.6/site-packages/flask/app.py", line 1799, in dispatch_request
return self.view_functionsrule.endpoint
File "/usr/lib/python3.6/site-packages/flask_restplus/api.py", line 319, in wrapper
resp = resource(*args, **kwargs)
File "/usr/lib/python3.6/site-packages/flask/views.py", line 88, in view
return self.dispatch_request(*args, **kwargs)
File "/usr/lib/python3.6/site-packages/flask_restplus/resource.py", line 44, in dispatch_request
resp = meth(*args, **kwargs)
File "/usr/lib/python3.6/site-packages/flask_restplus/marshalling.py", line 136, in wrapper
resp = f(*args, **kwargs)
File "/usr/lib/python3.6/site-packages/baseapp_for_restapi_backend_with_swagger/AppObj.py", line 329, in _
return funct(*args, **kwargs)
File "/app/APIexplore.py", line 106, in get
raise e
File "/app/APIexplore.py", line 104, in get
return appObj.objectStore.executeInsideConnectionContext(dbfn)
File "/usr/lib/python3.6/site-packages/object_store_abstraction/objectStores_base.py", line 281, in executeInsideConnectionContext
a = fnToExecute(context)
File "/app/APIexplore.py", line 98, in dbfn
userObj = appObj.operationsLogic.getUserObjFromDecodedJWTToken(token=decodedJWTToken, storeConnection=storeConnection)
File "/app/OperationsLogic.py", line 125, in getUserObjFromDecodedJWTToken
usrObj = self.getUserObj(token.getUserID(), storeConnection=storeConnection, token=token)
File "/app/OperationsLogic.py", line 102, in getUserObj
namespaceExistsFn=namespaceExistsFn
File "/app/UserRepository.py", line 26, in get
userObj = RepositoryBaseClass.get(self, id, storeConnection)
File "/app/RepositoryBaseClass.py", line 50, in get
obj, objVersion, creationDateTime, lastUpdateDateTime, objKey = storeConnection.getObjectJSON(self.objectStoreTypeString,id)
File "/usr/lib/python3.6/site-packages/object_store_abstraction/objectStores_base.py", line 161, in getObjectJSON
return self._getObjectJSON(objectType, objectKey)
File "/usr/lib/python3.6/site-packages/object_store_abstraction/objectStores_DynamoDB.py", line 129, in _getObjectJSON
'partition_key': partition_key
File "/usr/lib/python3.6/site-packages/boto3/resources/factory.py", line 520, in do_action
response = action(self, *args, **kwargs)
File "/usr/lib/python3.6/site-packages/boto3/resources/action.py", line 83, in call
response = getattr(parent.meta.client, operation_name)(**params)
File "/usr/lib/python3.6/site-packages/botocore/client.py", line 357, in _api_call
return self._make_api_call(operation_name, kwargs)
File "/usr/lib/python3.6/site-packages/botocore/client.py", line 661, in _make_api_call
raise error_class(parsed_response, operation_name)
botocore.errorfactory.ResourceNotFoundException: An error occurred (ResourceNotFoundException) when calling the GetItem operation: Requested resource not found

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant