Uploaded image for project: 'Rust Driver'
  1. Rust Driver
  2. RUST-679

Simplify error API to ease pattern matching

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 2.0.0-alpha.1
    • Affects Version/s: None
    • Component/s: None
    • None

      Currently, our error type internally uses an Arc to wrap our ErrorKind enum, which makes pattern matching to determine the type of error that occurred rather cumbersome. Our original rationale for this API was that we needed to be able to copy our Error type internally for some of the SDAM machinery. However, we never actually return the copied errors to users, instead constructing new ones from scratch from the server selection logic. This means that we can simply our error type so that Arc is no longer used, and then we can use Arc<Error> internally where needed.

            Assignee:
            sam.rossi@mongodb.com Samuel Rossi (Inactive)
            Reporter:
            sam.rossi@mongodb.com Samuel Rossi (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: