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

Failure modes for update and delete operations #237

Merged
merged 14 commits into from
Mar 9, 2023

Conversation

maheshrajamani
Copy link
Contributor

@maheshrajamani maheshrajamani commented Mar 9, 2023

What this PR does:
Delete and Update operation - fail silently

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

Checklist

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

@maheshrajamani maheshrajamani marked this pull request as ready for review March 9, 2023 15:45
@maheshrajamani maheshrajamani requested a review from a team as a code owner March 9, 2023 15:45
String message =
"Failed to update document with _id %s: %s".formatted(documentId, throwable.getMessage());
"Failed to update documents with _id %s: %s".formatted(documentIds, throwable.getMessage());
Copy link
Contributor

Choose a reason for hiding this comment

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

I think that similar to exception key, formatting of documentIds probably should be a shared utility method since we may want to add quoting/escaping at some point -- start with just List.toString() for now, but I have found that it is good to distinguish f.ex between number 1 and String "1"... especially as String keys can have all kind of content.

Copy link
Contributor

Choose a reason for hiding this comment

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

Come to think of this, since the only value where simple "value.toString()" may not be sufficient is String (where we'd want to surround value in quotes), we could easily change toString() method for DocumentId.StringId and the message would be changed?

Downside is that there are lots of tests that compare exact exception message.

I can do a PR after merging this one so as not to extend scope here.

Copy link
Contributor

@tatu-at-datastax tatu-at-datastax left a comment

Choose a reason for hiding this comment

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

LGTM

@maheshrajamani maheshrajamani merged commit 4a25ecb into main Mar 9, 2023
@maheshrajamani maheshrajamani deleted the delete-update-error-aggregate branch March 9, 2023 18:45
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.

Implement failure modes for update and delete operations
2 participants