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

Throw exceptions for BSON (de)serialization errors

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.0.0-alpha1
    • Affects Version/s: 0.6.3
    • Component/s: None
    • None

      Per the serialization spec, an MongoDB\Driver\Exception\UnexpectedValueException should be thrown when:

      • bsonSerialize() does not return an array or stdClass instance

      An MongoDB\Driver\Exception\InvalidArgumentException should be thrown when:

      • The custom class specified in the type map does not exist, does not implement Unserializable, or is not instantiatable (i.e. it's abstract).

      We don't throw exceptions if the deserialization class inferred by __pclass is unusable (i.e. missing, not Unserializable, or not instantiatable).

            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: