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

Implement accessor for error labels on exception classes

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Critical - P2
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.6.0, 1.6.0alpha1
    • Labels:
      None

      Description

      CDRIVER-2558 introduced a mongoc_error_has_label() function, which can be used to inspect any bson_t reply returned by its API. This covers queries, commands, and write operations.

      We should provide access to these labels so that users can make decisions about error handling (e.g. retrying transactions due to an error with the "TransientTransactionError" label). Since these labels can be set by both the server or libmongoc (for client errors such as dropped connections), this new API likely belongs on the RuntimeException class. We should confirm that it's not relevant to LogicException or its sub-classes.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: