Exception: WifiWand::NetworkAuthenticationError

Inherits:
Error
  • Object
show all
Defined in:
lib/wifi_wand/errors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_nameObject (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

#reasonObject (readonly)

Returns the value of attribute reason.



68
69
70
# File 'lib/wifi_wand/errors.rb', line 68

def reason
  @reason
end