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

Simplify error API to ease pattern matching

    XMLWordPrintable

    Details

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

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved: