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

Improve error handling in new 2.0 driver

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.0.1, 2.1
    • Affects Version/s: 2.0
    • Component/s: Error Handling
    • None

      The 1.* version was able to provide server-side messages on all write operations. The application was able to rely on those. Now all errors are being replaced with exceptions that is a good improvement. But messages in those exceptions are very generic and cannot be used nor by the application, nor for debugging purposes to resolve the issue.

      For example unique index violation on the server side produces the MongoBulkWriteException with the following message "A bulk write operation resulted in one or more errors." - no mentioning of index even...

      The other example, client side this time. The use of "." in the BsonElement for the field name (like "name.partial") is prohibitive. But trying to use such will result into the EndOfStreamException with generic message as well.

      It would be very helpful if exception messages describe what the issue is, not what the decision is being made by the driver; and server-side messages must be preserved as they are helpful.

            Assignee:
            craig.wilson@mongodb.com Craig Wilson
            Reporter:
            lennygran Lenny Granovsky
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: