lib/amqp/exceptions.rb in amqp-0.8.0.rc3 vs lib/amqp/exceptions.rb in amqp-0.8.0.rc4
- old
+ new
@@ -21,24 +21,33 @@
# Raised when initial TCP connection to the broker fails.
# @api public
class TCPConnectionFailed < Error
-
- #
- # API
- #
-
# @return [Hash] connection settings that were used
attr_reader :settings
def initialize(settings, cause = nil)
@settings = settings
@cause = cause
super("Could not estabilish TCP connection to #{@settings[:host]}:#{@settings[:port]}")
end # TCPConnectionFailed
end
+
+ # Raised when authentication fails.
+ # @api public
+ class PossibleAuthenticationFailureError < Error
+ # @return [Hash] connection settings that were used
+ 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}")
+ end # initialize(settings)
+ end # PossibleAuthenticationFailureError
+
# Raised when queue (or exchange) declaration fails because another queue with the same
# name but different attributes already exists in the channel object cache.
# @api public