Exception: WifiWand::NetworkConnectionError

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, source: nil) ⇒ NetworkConnectionError

Returns a new instance of NetworkConnectionError.



44
45
46
47
48
49
50
51
# File 'lib/wifi_wand/errors.rb', line 44

def initialize(network_name:, reason: nil, source: nil)
  @network_name = network_name
  @reason = reason
  @source = source
  msg = "Failed to connect to network '#{network_name}'"
  msg += ": #{reason}" if reason
  super(msg)
end

Instance Attribute Details

#network_nameObject (readonly)

Returns the value of attribute network_name.



42
43
44
# File 'lib/wifi_wand/errors.rb', line 42

def network_name
  @network_name
end

#reasonObject (readonly)

Returns the value of attribute reason.



42
43
44
# File 'lib/wifi_wand/errors.rb', line 42

def reason
  @reason
end

#sourceObject (readonly)

Returns the value of attribute source.



42
43
44
# File 'lib/wifi_wand/errors.rb', line 42

def source
  @source
end