[GODRIVER-2818] Deprecate unnecessary error values and types in "bsoncodec" Created: 21/Apr/23  Updated: 28/Oct/23  Resolved: 01/Jun/23

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

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

Epic Link: Go Driver 2.0 Prep
Quarter: FY24Q1, FY24Q2
Documentation Changes: Not Needed
Documentation Changes Summary:

1. What would you like to communicate to the user about this feature?
2. Would you like the user to see examples of the syntax and/or executable code and its output?
3. Which versions of the driver/connector does this apply to?


 Description   

There are a number of exported error values and types in the bsoncodec package that do not need to be exported.

Errors that indicate an implementation error typically do not need to support comparison at runtime because we expect users will fix the implementation error rather than write error handling logic. There are a number of exported error values and types in the bsoncodec package that are only used to signal an implementation error and don't need to be exported:

Error values:

  • ErrNilType
  • ErrNotPointer
  • ErrNotInterface

Error types:

  • ErrNoEncoder
  • ErrNoDecoder
  • ErrNoTypeMapEntry

We still need to return errors in most of those cases, but we don't expect users to write error handling logic when any of the above errors are returned.

Definition of done:

  • Deprecate all listed error values and types.


 Comments   
Comment by Githook User [ 01/Jun/23 ]

Author:

{'name': 'Matt Dale', 'email': '9760375+matthewdale@users.noreply.github.com', 'username': 'matthewdale'}

Message: GODRIVER-2818 Deprecate bsoncodec errors that will be removed in Go Driver 2.0 (#1271)
Branch: master
https://github.com/mongodb/mongo-go-driver/commit/bd4d3f69852f00bea1804b5248e45846545010fb

Comment by Matt Dale [ 26/May/23 ]

PR: https://github.com/mongodb/mongo-go-driver/pull/1271

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