lib/amqp/exceptions.rb in amqp-1.0.0.pre2 vs lib/amqp/exceptions.rb in amqp-1.0.0
- old
+ new
@@ -28,11 +28,11 @@
def initialize(settings, cause = nil)
@settings = settings
@cause = cause
- super("Could not estabilish TCP connection to #{@settings[:host]}:#{@settings[:port]}")
+ super("Could not establish TCP connection to #{@settings[:host]}:#{@settings[:port]}")
end # TCPConnectionFailed
end
# Raised when authentication fails.
# @api public
@@ -41,11 +41,20 @@
attr_reader :settings
def initialize(settings)
@settings = settings
- super("AMQP broker closed TCP connection before authentication succeeded: this usually means authentication failure due to misconfiguration. Settings are #{settings.inspect}")
+ super("AMQP broker closed TCP connection before authentication succeeded: this usually means authentication failure due to misconfiguration. Settings are #{filtered_settings.inspect}")
end # initialize(settings)
+
+ def filtered_settings
+ filtered_settings = settings.dup
+ [:pass, :password].each do |sensitve_setting|
+ filtered_settings[sensitve_setting] &&= '[filtered]'
+ end
+
+ filtered_settings
+ end
end # PossibleAuthenticationFailureError
# Raised when queue (or exchange) declaration fails because another queue with the same