Uploaded image for project: 'PHP Driver: Extension'
  1. PHP Driver: Extension
  2. PHPC-922

Improve specificity in generic corrupt BSON exception message

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.5.0
    • Affects Version/s: 1.2.5
    • Component/s: None
    • None

      When bson_iter_visit_all() fails, we throw an UnexpectedValueException with a generic "Detected corrupt BSON data" message if one of our callbacks has not already thrown an exception. The generic message generally occurs after an UTF-8 validation error internal to libbson, in which case we may have a byte offset available to include. Ideally, we should try to include a field path. libbson will not report the specific field for its validation error, so we would be limited to the field path up to but no including the offending field (e.g. an error in a top-level field would have no information since it exists at the root level).

            Assignee:
            derick Derick Rethans
            Reporter:
            jmikola@mongodb.com Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: