Exception: WifiWand::MacOsRedactionError

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

Constant Summary collapse

DEFAULT_REASON =
'macOS is redacting WiFi network names until Location Services access is granted ' \
'to wifiwand-helper, the macOS helper application'
DEFAULT_REMEDIATION =
'Run `wifiwand-macos-setup`, grant Location Services to ' \
'`wifiwand-helper`, the macOS helper application, and retry.'

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Error

#append_help_hint?, #display_message, #exception, #message_for_display

Constructor Details

#initialize(operation_description: 'this operation', reason: nil, remediation: nil) ⇒ MacOsRedactionError

Returns a new instance of MacOsRedactionError.



298
299
300
301
302
303
304
305
306
307
# File 'lib/wifi_wand/errors.rb', line 298

def initialize(operation_description: 'this operation', reason: nil, remediation: nil)
  @operation_description = operation_description
  @reason = reason || DEFAULT_REASON
  @remediation = remediation || DEFAULT_REMEDIATION

  super(
    "Exact WiFi network identity is required for #{operation_description}, but #{@reason}. " \
      "#{@remediation}"
  )
end

Instance Attribute Details

#operation_descriptionObject (readonly)

Returns the value of attribute operation_description.



296
297
298
# File 'lib/wifi_wand/errors.rb', line 296

def operation_description
  @operation_description
end

#reasonObject (readonly)

Returns the value of attribute reason.



296
297
298
# File 'lib/wifi_wand/errors.rb', line 296

def reason
  @reason
end

#remediationObject (readonly)

Returns the value of attribute remediation.



296
297
298
# File 'lib/wifi_wand/errors.rb', line 296

def remediation
  @remediation
end