Skip to content

Commit 51ecabd

Browse files
prestonvasquezpengzhenyi2015benjirewis
authored
GODRIVER-2489 Return error if createPipelineOptionsDoc() fails (#1035)
Co-authored-by: Preston Vasquez <[email protected]> Co-authored-by: pengzhenyi <[email protected]> Co-authored-by: Benjamin Rewis <[email protected]>
1 parent e6f6f26 commit 51ecabd

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

mongo/change_stream.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,9 @@ func (cs *ChangeStream) executeOperation(ctx context.Context, resuming bool) err
257257
cs.replaceOptions(cs.wireVersion)
258258

259259
csOptDoc := cs.createPipelineOptionsDoc()
260+
if cs.err != nil {
261+
return cs.Err()
262+
}
260263
pipIdx, pipDoc := bsoncore.AppendDocumentStart(nil)
261264
pipDoc = bsoncore.AppendDocumentElement(pipDoc, "$changeStream", csOptDoc)
262265
if pipDoc, cs.err = bsoncore.AppendDocumentEnd(pipDoc, pipIdx); cs.err != nil {

0 commit comments

Comments
 (0)