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

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

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Done
    • Icon: Minor - P4 Minor - P4
    • 1.3
    • 1.1
    • None
    • All

    Description

      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.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: