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

Throw specific exceptions for maxTimeMS timeouts (commands and queries)

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 0.1.5
    • Affects Version/s: None
    • Component/s: None
    • None

      In the 1.x driver, MongoExecutionTimeoutException is only thrown for maxTimeMS timeouts during queries. Command helpers may only throw MongoResultException after inspecting the command result's "ok" field. Ideally, we'd have specific exceptions for their maxTimeMS timeouts as well.

      This is tricky in 1.x, since MongoExecutionTimeoutException is not an instance of MongoResultException, which users currently know to expect. Introducing a new exception in 1.x could be a BC break, so this is probably best considered for the next major version of the driver.

      Note: I'm not counting MongoCursorTimeoutException here, which is thrown by everything for client-side socket timeouts.

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

              Created:
              Updated:
              Resolved: