Exception: AMQP::PossibleAuthenticationFailureError

Inherits:
Error
  • Object
show all
Defined in:
lib/amqp/exceptions.rb

Overview

Raised when authentication fails.

Instance Attribute Summary collapse

Attributes inherited from Error

#cause

Instance Method Summary collapse

Constructor Details

#initialize(settings) ⇒ PossibleAuthenticationFailureError

Returns a new instance of PossibleAuthenticationFailureError.



43
44
45
46
47
# File 'lib/amqp/exceptions.rb', line 43

def initialize(settings)
  @settings = settings

  super("AMQP broker closed TCP connection before authentication succeeded: this usually means authentication failure due to misconfiguration. Settings are #{filtered_settings.inspect}")
end

Instance Attribute Details

#settingsHash (readonly)

Returns connection settings that were used.

Returns:

  • (Hash)

    connection settings that were used



41
42
43
# File 'lib/amqp/exceptions.rb', line 41

def settings
  @settings
end

Instance Method Details

#filtered_settingsObject

initialize(settings)



49
50
51
52
53
54
55
56
# File 'lib/amqp/exceptions.rb', line 49

def filtered_settings
  filtered_settings = settings.dup
  [:pass, :password].each do |sensitve_setting|
    filtered_settings[sensitve_setting] &&= '[filtered]'
  end

  filtered_settings
end