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

Consider error document for cursor exceptions

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 1.5.4
    • Affects Version/s: None
    • Component/s: None
    • None

      phongo_cursor_advance_and_check_for_error() should use mongoc_cursor_error_document() instead of mongoc_cursor_error(), as the former exposes data that can be used to populate the result document and/or error labels on an exception.

      Currently, executeQuery() is limited to throwing a ServerException on server errors, which does not include the result document. With this change, phongo_cursor_advance_and_check_for_error can start using phongo_throw_exception_from_bson_error_t_and_reply() to throw a CommandException and make the result document accessible to the user.

      While 1.5.x does not expose error labels on RuntimeExceptions (PHPC-1222), this change will also ensure that query errors expose error labels in 1.6.0, which will be helpful for applications utilizing transactions.

            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: