[GODRIVER-2243] IndexView.CreateMany should wrap driver.ErrUnacknowledgedWrite Created: 25/Nov/21  Updated: 28/Oct/23  Resolved: 01/Dec/21

Status: Closed
Project: Go Driver
Component/s: None
Affects Version/s: None
Fix Version/s: 1.8.1

Type: Bug Priority: Unknown
Reporter: Reilly Watson Assignee: Matt Dale
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

If I create an index like so:

iv := db.Collection("foo", options.Collection().SetWriteConcern(writeconcern.New(writeconcern.W(0)))).Indexes()
_, err := iv.CreateOne(context.TODO(), mongo.IndexModel{Keys: bson.D{{Key: "user_id", Value: 1}}})

I get back the error go.mongodb.org/mongo-driver/x/mongo/driver.ErrUnacknowledgedWrite. This should presumably be mongo.ErrUnacknowledgedWrite! Other operations that return this call processWriteErr() to transform it, but it's missing from IndexView.CreateMany().



 Comments   
Comment by Githook User [ 08/Dec/21 ]

Author:

{'name': 'Reilly Watson', 'email': 'reillywatson@gmail.com', 'username': 'reillywatson'}

Message: GODRIVER-2243 Wrap write errors in IndexView.CreateMany (#820)
Branch: release/1.8
https://github.com/mongodb/mongo-go-driver/commit/d3f6dae0fd9d881a3dce55dc57fca91d4f539b36

Comment by Githook User [ 01/Dec/21 ]

Author:

{'name': 'Reilly Watson', 'email': 'reillywatson@gmail.com', 'username': 'reillywatson'}

Message: GODRIVER-2243 Wrap write errors in IndexView.CreateMany (#820)
Branch: master
https://github.com/mongodb/mongo-go-driver/commit/52614f927b120bd7cb5e5f03cb33c053814e6640

Comment by Kevin Albertson [ 29/Nov/21 ]

Thank you for the report and PR rwatson@league.com! We will take a look at this soon.

Generated at Thu Feb 08 08:38:08 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.