Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-155

Support for error codes in command results and exceptions

    • Type: Icon: New Feature New Feature
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: 1.0
    • Component/s: Feature Request
    • None

      I would like to suggest adding support for error codes in command results and (probably) exceptions, so handling specific type of errors is easier.
      Comparing error messages to a predefined string seems weak to me. While current driver has only one such spot (the 'commandResult.ErrorMessage == "not master"' check in MongoDatabase.cs, I don't know if this is the only and proper message to close connection for), not having access to error code makes writing robust client-side code harder.

            Assignee:
            Unassigned Unassigned
            Reporter:
            onyxmaster Aristarkh Zagorodnikov
            Votes:
            4 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: