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

When calling ToBsonDocument() on an extension method, throw a more useful exception

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 1.3
    • Affects Version/s: 1.1
    • Component/s: None
    • Environment:
      All

      The line Console.WriteLine("A String".ToBsonDocument()); throws InvalidOperationException WriteString can only be called when State is Value, not when State is Initial. A more useful exception should be thrown higher up.

            Assignee:
            robert@mongodb.com Robert Stam
            Reporter:
            zippy1981 Justin Dearing
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: