Skip to content

Commit

Permalink
GODRIVER-2489 Return error if createPipelineOptionsDoc() fails (#1035)
Browse files Browse the repository at this point in the history
Co-authored-by: Preston Vasquez <prestonvasquez@icloud.com>
Co-authored-by: pengzhenyi <503282373@qq.com>
Co-authored-by: Benjamin Rewis <32186188+benjirewis@users.noreply.github.com>
  • Loading branch information
3 people authored Aug 1, 2022
1 parent e6f6f26 commit 51ecabd
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 51ecabd

Please sign in to comment.