[GODRIVER-2744] Do not return "bsoncore" errors from the "bson" API Created: 01/Feb/23  Updated: 08/Jan/24

Status: Backlog
Project: Go Driver
Component/s: BSON
Affects Version/s: None
Fix Version/s: 2.0.0

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

Issue Links:
Duplicate
is duplicated by GODRIVER-2840 Lookup* API should return public erro... Closed
Epic Link: Go Driver 2.0 BSON
Quarter: FY24Q3
Backwards Compatibility: Major Change

 Description   

The bson API will currently return errors defined in the bsoncore package. Errors include:

  • bsoncore.ErrNilReader
  • bsoncore.ErrEmptyKey
  • bsoncore.ErrOutOfBounds
  • bsoncore.ErrElementNotFound (from Raw.LookupErr)
  • bsoncore.InsufficientBytesError (from Raw.LookupErr)
  • bsoncore.InvalidDepthTraversalError (from Raw.LookupErr)

Since bsoncore is an unstable API, we shouldn't require users to use error values from that package to use the stable bson API. Move or replace all bsoncore error values so that the bson API only returns errors defined in the bson package.

Definition of done:

  • All bson package APIs do not return any errors defined in the bsoncore package (or any other unstable package).

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