Uploaded image for project: 'Ruby Driver'
  1. Ruby Driver
  2. RUBY-1575

Prohibit empty seed list in client constructor

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Trivial - P5 Trivial - P5
    • 3.0.0
    • Affects Version/s: None
    • Component/s: Dev Exp

      The client requires an array of seeds or a URI, but the array can be empty:

      irb(main):001:0> Mongo::Client.new([])
      D, [2018-11-07T14:16:30.258387 #18327] DEBUG -- : MONGODB | EVENT: #<TopologyOpening topology=Unknown[]>
      D, [2018-11-07T14:16:30.258561 #18327] DEBUG -- : MONGODB | Topology type 'unknown' initializing.
      => #<Mongo::Client:0x46962734145360 cluster=#<Cluster topology=Unknown[] servers=[]>>
      

      The result is not very useful.

      The client refusing to instantiate with an empty seed list may catch errors when someone does something like Mongo::Client.new([*seeds]).

            Assignee:
            Unassigned Unassigned
            Reporter:
            oleg.pudeyev@mongodb.com Oleg Pudeyev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: