Exception: WifiWand::NetworkAuthenticationError
- Defined in:
- lib/wifi_wand/errors.rb
Instance Attribute Summary collapse
-
#network_name ⇒ Object
readonly
Returns the value of attribute network_name.
-
#reason ⇒ Object
readonly
Returns the value of attribute reason.
Instance Method Summary collapse
-
#initialize(network_name:, reason: nil) ⇒ NetworkAuthenticationError
constructor
A new instance of NetworkAuthenticationError.
Methods inherited from Error
#append_help_hint?, #display_message, #exception, #message_for_display
Constructor Details
#initialize(network_name:, reason: nil) ⇒ NetworkAuthenticationError
Returns a new instance of NetworkAuthenticationError.
70 71 72 73 74 75 76 77 |
# File 'lib/wifi_wand/errors.rb', line 70 def initialize(network_name:, reason: nil) @network_name = network_name @reason = reason msg = "Authentication failed for network '#{network_name}'" msg += ": #{reason}" if reason msg += '. Please verify the password is correct' unless reason&.include?('password') super(msg) end |
Instance Attribute Details
#network_name ⇒ Object (readonly)
Returns the value of attribute network_name.
68 69 70 |
# File 'lib/wifi_wand/errors.rb', line 68 def network_name @network_name end |
#reason ⇒ Object (readonly)
Returns the value of attribute reason.
68 69 70 |
# File 'lib/wifi_wand/errors.rb', line 68 def reason @reason end |