-
Notifications
You must be signed in to change notification settings - Fork 614
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
Add option for ignoring non-existent documents #33174
Conversation
There is an important distinction between ignoring missing document errors, and ignoring all errors which this diff appears to do. We wanted the "document missing" error still reported via stderr (so it didn't break In the end we used the following change against v8.460.16: diff --git a/client/go/internal/cli/cmd/document.go b/client/go/internal/cli/cmd/document.go
index 267f0e91c29..4e084c20c77 100644
--- a/client/go/internal/cli/cmd/document.go
+++ b/client/go/internal/cli/cmd/document.go
@@ -122,7 +122,9 @@ func readDocuments(ids []string, timeoutSecs int, waiter *Waiter, printCurl bool
for _, docId := range parsedIds {
result := client.Get(docId, fieldSet)
if err := printResult(cli, operationResult(true, document.Document{Id: docId}, service, result), true); err != nil {
- return err
+ if result.HTTPStatus != 404 {
+ return err
+ }
}
} Also, I apologize for not providing a PR for our change as I had indicated I would. We've been really busy launching a couple things, and I hadn't had a chance to put something together. What you have is basically what I was considering, save the detail above. |
Thanks! I considered ignoring 404 only, but thought that might be too strict for your use case. I'll make the change. |
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.
looks good to me
44d7e38
to
bcd9bd2
Compare
Needs another approval after I fixed a conflict. |
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.
👍
The user might want to read a set of documents where one or more of them may not
exist, without CLI returning errors. This was requested by @wix-mikej.
@bratseth or @kkraune