Exception: WifiWand::DnsConfigurationError

Inherits:
ConfigurationError 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(connection_name:, step:, cause_error:, rollback_error: nil) ⇒ DnsConfigurationError

Returns a new instance of DnsConfigurationError.



344
345
346
347
348
349
350
351
352
353
# File 'lib/wifi_wand/errors.rb', line 344

def initialize(connection_name:, step:, cause_error:, rollback_error: nil)
  @connection_name = connection_name
  @step = step
  @cause_error = cause_error
  @rollback_error = rollback_error

  super(
    "Failed to update DNS for connection '#{connection_name}' while #{step_description}: #{error_detail}"
  )
end

Instance Attribute Details

#cause_errorObject (readonly)

Returns the value of attribute cause_error.



342
343
344
# File 'lib/wifi_wand/errors.rb', line 342

def cause_error
  @cause_error
end

#connection_nameObject (readonly)

Returns the value of attribute connection_name.



342
343
344
# File 'lib/wifi_wand/errors.rb', line 342

def connection_name
  @connection_name
end

#rollback_errorObject (readonly)

Returns the value of attribute rollback_error.



342
343
344
# File 'lib/wifi_wand/errors.rb', line 342

def rollback_error
  @rollback_error
end

#stepObject (readonly)

Returns the value of attribute step.



342
343
344
# File 'lib/wifi_wand/errors.rb', line 342

def step
  @step
end

Instance Method Details

#to_hObject



355
356
357
358
359
360
361
362
363
# File 'lib/wifi_wand/errors.rb', line 355

def to_h
  base = {
    connection_name: connection_name,
    step:            step,
    error:           error_summary(cause_error),
  }
  base[:rollback_error] = error_summary(rollback_error) if rollback_error
  base
end