Class: Mongo::Error::InvalidURI
- Inherits:
-
Error
- Object
- Error
- Mongo::Error::InvalidURI
- Defined in:
- lib/mongo/error/invalid_uri.rb
Overview
Exception that is raised when trying to parse a URI that does not match the specification.
Instance Method Summary collapse
-
#initialize(_uri, details, format = nil) ⇒ InvalidURI
constructor
Instantiate the new exception.
Constructor Details
#initialize(_uri, details, format = nil) ⇒ InvalidURI
Instantiate the new exception.
The message deliberately contains no part of the connection string. A string that failed to parse cannot be redacted reliably: the parser and the redactor can disagree about where the userinfo ends, so masking the input may still disclose a credential. The details supplied by the parser identify the component at fault by name instead. See the "Disclosure of Sensitive Values" section of the connection string specification.
43 44 45 46 47 48 |
# File 'lib/mongo/error/invalid_uri.rb', line 43 def initialize(_uri, details, format = nil) = "#{details}\n" += "MongoDB URI must be in the following format: #{format}\n" if format += "Please see the following URL for more information: #{Mongo::URI::HELP}\n" super() end |