[GODRIVER-2325] Expose server reply in errors Created: 03/Mar/22  Updated: 18/Jul/22  Resolved: 24/Mar/22

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

Type: New Feature Priority: Critical - P2
Reporter: Kevin Albertson Assignee: Benji Rewis (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Related
related to GODRIVER-2487 Provide access to raw result document... Closed

 Description   

Background & Motivation

There is an internal use case to check for a field in server error replies.

This field is not exposed by any of the existing error types: CommandError, WriteError, WriteException, BulkWriteException.

Scope
Expose the full server reply in error types.

Investigate possible options for exposing this API.

Consider adding a method to the ServerError interface.

An alternative is to return a wrapped error containing the full server reply.



 Comments   
Comment by Githook User [ 29/Mar/22 ]

Author:

{'name': 'Jason Chan', 'email': 'jason.chan@mongodb.com', 'username': 'jasonjhchan'}

Message: REP-347 Implement per-shard change streams and update go driver version to include GODRIVER-2337,GODRIVER-2325 (#241)
Branch: main
https://github.com/10gen/mongosync/commit/59f9953dc32b352b8891a0c7e7f6880d4fa106c7

Comment by Githook User [ 24/Mar/22 ]

Author:

{'name': 'Benjamin Rewis', 'email': '32186188+benjirewis@users.noreply.github.com', 'username': 'benjirewis'}

Message: GODRIVER-2325 Expose raw server response in relevant errors (#871)
Branch: master
https://github.com/mongodb/mongo-go-driver/commit/57747f8fe7130b6afdade2a946d399afe6ae7079

Comment by Benji Rewis (Inactive) [ 10/Mar/22 ]

Here's an investigatory PR of a new RawResponse method on ServerErrorhttps://github.com/mongodb/mongo-go-driver/pull/871.

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