Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-3571

Improve error when invalid session is passed in collection methods (v4)

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: Error

      When a user passes in an invalid session object to one of the collection methods, we should fail early instead of letting it fall through and throw errors that are confusing to the user down the line.

      For example, passing in a number as the session option throws "TypeError: session.inTransaction is not a function" (coming from utils -> resolveOptions).

      AC

      • Add a proper validation error for session option
      • Add unit test

            Assignee:
            Unassigned Unassigned
            Reporter:
            daria.pardue@mongodb.com Daria Pardue
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: