class Mongo::Error::InvalidURI

Exception that is raised when trying to parse a URI that does not match the specification.

@since 2.0.0

Public Class Methods

new(uri, details, format = nil) click to toggle source

Instantiate the new exception.

@example Instantiate the exception.

Mongo::Error::InvalidURI.new(uri, details, format)

@since 2.0.0

Calls superclass method Mongo::Error::new
# File lib/mongo/error/invalid_uri.rb, line 30
def initialize(uri, details, format = nil)
  message = "Bad URI: #{uri}\n" +
              "#{details}\n"
  message += "MongoDB URI must be in the following format: #{format}\n" if format
  message += "Please see the following URL for more information: #{Mongo::URI::HELP}\n"
  super(message)
end