Type Mismatch Errors during decode should use a custom type

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: BSON, Error Handling
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      When a type mismatch error occurs during decoding a struct or slice, the driver should return a typed error such that I can check specifically for that and do something with it different than other types of decode errors. 

      Something like

      type TypeMismatchError struct {
          Got bsontype.Type
          Expected bsontype.Type
      }
      

            Assignee:
            Unassigned
            Reporter:
            Craig Wilson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: