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

Use consistent exceptions for BSON initialization methods

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.2.0-alpha1, 1.2.0
    • Affects Version/s: 1.1.8
    • Component/s: None
    • Labels:
      None

      As of PHPC-460, the _construct(), set_state(), and _wakeup() methods in BSON classes use the same init functions. Those init functions should be responsible for throwing exceptions (they currently just return true/false) to ensure consistent error reporting for each method of instantiating a BSON object.

      This is not a concern for MongoDB\BSON\toPHP(), as they would already throw for invalid BSON data.

            Assignee:
            jmikola@mongodb.com Jeremy Mikola
            Reporter:
            jmikola@mongodb.com Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: