Consider error document for cursor exceptions

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 1.5.4
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • 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:
              Jeremy Mikola
              Reporter:
              Jeremy Mikola
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: