Uploaded image for project: 'Go Driver'
  1. Go Driver
  2. GODRIVER-2818

Deprecate unnecessary error values and types in "bsoncodec"

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • 1.12.0
    • Affects Version/s: None
    • Component/s: BSON
    • Labels:
      None
    • Not Needed
    • Hide

      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?

      Show
      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?

      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.

            Assignee:
            matt.dale@mongodb.com Matt Dale
            Reporter:
            matt.dale@mongodb.com Matt Dale
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: