Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-8980

ConnectionString::parse on some invalid input throws exception, on others returns an invalid ConnectionString

    • Type: Icon: Task Task
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Internal Code
    • Labels:
      None

      ConnectionString::parse will return an empty ConnectionString (which will return false on calls to isValid()) on certain kinds of invalid input.

      It also, however, calls the HostAndPort constructor, which can throw an exception on invalid input (and prints a stack trace). This means that ConnectionString::parse has inconsistent behavior on invalid input.

      The simple approach of catching the exception thrown by HostAndPort() would work, but still presents a user experience problem as a stack trace will still print for the error thrown.

            Assignee:
            schwerin@mongodb.com Andy Schwerin
            Reporter:
            spencer@mongodb.com Spencer Brody (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: