Skip to content

Commit

Permalink
GODRIVER-2489 Return error if createPipelineOptionsDoc() failed in ex…
Browse files Browse the repository at this point in the history
…ecuteOperation() (#1020)

Co-authored-by: Preston Vasquez <prestonvasquez@icloud.com>
  • Loading branch information
pengzhenyi2015 and prestonvasquez authored Jul 28, 2022
1 parent f1bb3c7 commit a006621
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions mongo/change_stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,9 @@ func (cs *ChangeStream) executeOperation(ctx context.Context, resuming bool) err
cs.replaceOptions(cs.wireVersion)

csOptDoc := cs.createPipelineOptionsDoc()
if cs.err != nil {
return cs.Err()
}
pipIdx, pipDoc := bsoncore.AppendDocumentStart(nil)
pipDoc = bsoncore.AppendDocumentElement(pipDoc, "$changeStream", csOptDoc)
if pipDoc, cs.err = bsoncore.AppendDocumentEnd(pipDoc, pipIdx); cs.err != nil {
Expand Down

0 comments on commit a006621

Please sign in to comment.