Method: Chef::Formatters::ErrorInspectors::NodeLoadErrorInspector#add_explanation

Defined in:
lib/chef/formatters/error_inspectors/node_load_error_inspector.rb

#add_explanation(error_description) ⇒ Object



42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/chef/formatters/error_inspectors/node_load_error_inspector.rb', line 42

def add_explanation(error_description)
  case exception
  when Net::HTTPClientException, Net::HTTPFatalError
    humanize_http_exception(error_description)
  when Chef::Exceptions::PrivateKeyMissing
    error_description.section("Private Key Not Found:", "      Your private key could not be loaded. If the key file exists, ensure that it is\n      readable by \#{ChefUtils::Dist::Infra::PRODUCT}.\n    E\n    error_description.section(\"Relevant Config Settings:\", <<~E)\n      client_key        \"\#{api_key}\"\n    E\n  when EOFError\n    describe_eof_error(error_description)\n  when *NETWORK_ERROR_CLASSES\n    describe_network_errors(error_description)\n  else\n    error_description.section(\"Unexpected Error:\", \"\#{exception.class.name}: \#{exception.message}\")\n  end\nend\n")