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

    XMLWordPrintableJSON

Details

    • Icon: Task Task
    • Resolution: Duplicate
    • Icon: Major - P3 Major - P3
    • None
    • None
    • Internal Code
    • None

    Description

      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.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: