[JAVA-4421] Deprecate WriteConcernError errorLabels property Created: 02/Dec/21  Updated: 09/Nov/23  Resolved: 12/Jan/22

Status: Closed
Project: Java Driver
Component/s: Error Handling
Affects Version/s: None
Fix Version/s: 4.5.0

Type: Improvement Priority: Unknown
Reporter: Jeffrey Yemin Assignee: Jeffrey Yemin
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to JAVA-5153 Remove deprecated methods in WriteCon... Closed
Backwards Compatibility: Fully Compatible
Documentation Changes: Not Needed

 Description   

Currently the com.mongodb.bulk.WriteConcernError contains a Set<String property for error labels, based on a faulty assumption (based on our spec tests) that the writeConcernError document in the server response contains errorLabels, when in fact they are included as a field in the top-level response document. This has led to bugs, the known ones having been fixed in JAVA-4419, and some confusing code. Let's deprecate com.mongodb.bulk.WriteConcernError#errorLabels to start the process of getting rid of this.

Eventually we will also want to do the following:

  1. Consolidate errorLabel handing in MongoWriteConcernException, since currently they are added by the code that constructs MongoWriteConcernException. This will require a new constructor for that exception, and the others can be deprecated.
  2. Refactor code that creates instances of com.mongodb.bulk.WriteConcernError to stop relying on the errorLabels property


 Comments   
Comment by Githook User [ 12/Jan/22 ]

Author:

{'name': 'Ramasai Tadepalli', 'email': '18359686+ramasai1@users.noreply.github.com', 'username': 'ramasai1'}

Message: Deprecate WriteConcernError errorLabels property(#840)

JAVA-4421

Co-authored-by: Jeff Yemin <jeff.yemin@mongodb.com>
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/6f2aa50d51b7cacbad9f5d832797eaf01616e144

Comment by Cloud GitHub Webhooks [ 12/Jan/22 ]

jyemin merged a pull request (JAVA-4421 Remove errorLabels from WriteConcernError) into the following branch:
master: 6f2aa50d51b7cacbad9f5d832797eaf01616e144

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