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

fix collection not exist #612

Merged
merged 1 commit into from
Nov 2, 2023
Merged

fix collection not exist #612

merged 1 commit into from
Nov 2, 2023

Conversation

Yuqi-Du
Copy link
Contributor

@Yuqi-Du Yuqi-Du commented Nov 2, 2023

when collection does not exist, operation involves vsearch will not error out as "collection not exist", but "vector search not enabled on this collection" which is misleading.

Which issue(s) this PR fixes:
Fixes #609

Checklist

  • Changes manually tested
  • Automated Tests added/updated
  • Documentation added/updated
  • CLA Signed: DataStax CLA

@Yuqi-Du Yuqi-Du requested a review from a team as a code owner November 2, 2023 16:23
@Yuqi-Du Yuqi-Du merged commit 27d2a00 into main Nov 2, 2023
3 checks passed
@Yuqi-Du Yuqi-Du deleted the collection_not_exist_fix branch November 2, 2023 18:46
// collection does not exist
if (error instanceof RuntimeException rte
&& rte.getMessage()
.startsWith(ErrorCode.INVALID_COLLECTION_NAME.getMessage())) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not wrong, but in my experience it is usually best practice to check against the error code or some other constant other than the error message, because (1) error messages may change, (2) it is possible that there may be multiple types of errors that start with the same message. Not a blocker, just figured I'd point this out.

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

Successfully merging this pull request may close these issues.

Misleading error message on nonexisting table when implying vector-enabled
3 participants