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

Methods should check arguments before internal state

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Won't Fix
    • Icon: Minor - P4 Minor - P4
    • None
    • 1.5
    • None

    Description

      Methods that check arguments should do so before checking internal state, so that internal state doesn't mask invalid arguments.

      For example, classes that implement the freezable pattern should check for null arguments in property setters before checking whether the instance is frozen, so that attempting to set a property to null when the object is frozen should throw an ArgumentNullException instead of an InvalidOperationException.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: