-
Notifications
You must be signed in to change notification settings - Fork 16
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
Handle error when the namespace doesn't exist #557
Conversation
As we discussed, one good starting point is writing a (failing) integration test, and work from that. Change itself seems reasonable, although I wonder if missing/mistyped Table name would also result in |
new RuntimeException( | ||
new JsonApiException( | ||
ErrorCode.NAMESPACE_DOES_NOT_EXIST, | ||
"The provided namespace does not exist: " + namespace))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this meant to improve the following error that happens when you call find()
on a collection that doesn't exist?
Error: Command "find" failed with the following errors: [{"message":"INVALID_ARGUMENT: table articles22 does not exist","exceptionClass":"StatusRuntimeException"}]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vkarpov15 I think this is about namespace
, not collection (table)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This means to improve the error when the namespace doesn't exist, not the collection. I guess you got the error when you input the wrong collection name (or table
showed in the error message).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I second @tatu-at-datastax , an integration test that demonstrates how this error message is triggered would be excellent.
startsWith( | ||
"Failed to insert document with _id 'doc4': INVALID_ARGUMENT: keyspace something_else does not exist")) | ||
.body("errors[0].exceptionClass", is("StatusRuntimeException")); | ||
.body("errors[0].message", startsWith("The provided namespace does not exist")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor improvement request: check that namespace name is matched too (since it is now included).
Looks good so far: just needs one or more additional integration tests -- at least one more for one of "find" commands. |
Thank you for mentioning that. I added one more integration test for the find command. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Close issue #545 |
What this PR does:
Which issue(s) this PR fixes:
Fixes #545
Checklist