Exception: Wiq::AliasNotFoundError

Inherits:
ConfigError show all
Defined in:
lib/wiq/errors.rb

Instance Attribute Summary

Attributes inherited from Error

#code, #details, #exit_code, #hint

Instance Method Summary collapse

Constructor Details

#initialize(host, alias_name, available) ⇒ AliasNotFoundError

Returns a new instance of AliasNotFoundError.



54
55
56
57
58
59
60
61
62
63
64
65
# File 'lib/wiq/errors.rb', line 54

def initialize(host, alias_name, available)
  hint = if available.empty?
    "No credentials stored for this host. Run `wiq auth login`."
  else
    "Available aliases for #{host}: #{available.join(", ")}."
  end
  super(
    "No credential stored for #{host} under alias #{alias_name.inspect}.",
    code: "alias_not_found",
    hint: hint
  )
end