[GODRIVER-1075] Call SingleResult.setRdrContents() in SingleResult.Err() to return correct error Created: 20/May/19  Updated: 28/Oct/23  Resolved: 03/Jun/19

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

Type: Improvement Priority: Major - P3
Reporter: Ian Whalen (Inactive) Assignee: Emmanuel Eppinger (Inactive)
Resolution: Fixed Votes: 0
Labels: neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

The SingleResult type should have a HasResult method to check if there actually was a result. This can internally use setRdrContents and check the value of the rdr member.



 Comments   
Comment by Githook User [ 03/Jun/19 ]

Author:

{'name': 'Emmanuel', 'email': 'manny.eppinger@mongodb.com', 'username': 'eppingere'}

Message: Change SingleResult.Err() to call setRdrContents()

GODRIVER-1075

Change-Id: I810437125ae65c1e89f95f102b9cae4d2e2e82a2
Branch: master
https://github.com/mongodb/mongo-go-driver/commit/aca8709ee8680a1a1c98e804b301b8de99af06bd

Comment by Emmanuel Eppinger (Inactive) [ 31/May/19 ]

Done!

Comment by Divjot Arora (Inactive) [ 31/May/19 ]

Per offline discussion: ErrNoDocuments is more of an informative error and should be returned by SingleResult.Err. The work for this ticket will be to change SingleResult.Err to call setRdrContents so it can return the correct error.

Comment by Emmanuel Eppinger (Inactive) [ 31/May/19 ]

https://review.gerrithub.io/c/mongodb/mongo-go-driver/+/456506

 

 

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