summaryrefslogtreecommitdiff
path: root/lib/chef/formatters/error_inspectors/api_error_formatting.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chef/formatters/error_inspectors/api_error_formatting.rb')
-rw-r--r--lib/chef/formatters/error_inspectors/api_error_formatting.rb23
1 files changed, 11 insertions, 12 deletions
diff --git a/lib/chef/formatters/error_inspectors/api_error_formatting.rb b/lib/chef/formatters/error_inspectors/api_error_formatting.rb
index 0ea313eb92..2415d0f4bb 100644
--- a/lib/chef/formatters/error_inspectors/api_error_formatting.rb
+++ b/lib/chef/formatters/error_inspectors/api_error_formatting.rb
@@ -26,18 +26,18 @@ class Chef
NETWORK_ERROR_CLASSES = [Errno::ECONNREFUSED, Timeout::Error, Errno::ETIMEDOUT, SocketError]
def describe_network_errors(error_description)
- error_description.section("Networking Error:",<<-E)
+ error_description.section("Networking Error:", <<-E)
#{exception.message}
Your chef_server_url may be misconfigured, or the network could be down.
E
- error_description.section("Relevant Config Settings:",<<-E)
+ error_description.section("Relevant Config Settings:", <<-E)
chef_server_url "#{server_url}"
E
end
def describe_eof_error(error_description)
- error_description.section("Authentication Error:",<<-E)
+ error_description.section("Authentication Error:", <<-E)
Received an EOF on transport socket. This almost always indicates a network
error external to chef-client. Some causes include:
@@ -74,18 +74,18 @@ broken virtual networking code.
def describe_401_error(error_description)
if clock_skew?
- error_description.section("Authentication Error:",<<-E)
+ error_description.section("Authentication Error:", <<-E)
Failed to authenticate to the chef server (http 401).
The request failed because your clock has drifted by more than 15 minutes.
Syncing your clock to an NTP Time source should resolve the issue.
E
else
- error_description.section("Authentication Error:",<<-E)
+ error_description.section("Authentication Error:", <<-E)
Failed to authenticate to the chef server (http 401).
E
error_description.section("Server Response:", format_rest_error)
- error_description.section("Relevant Config Settings:",<<-E)
+ error_description.section("Relevant Config Settings:", <<-E)
chef_server_url "#{server_url}"
node_name "#{username}"
client_key "#{api_key}"
@@ -97,10 +97,10 @@ E
end
def describe_400_error(error_description)
- error_description.section("Invalid Request Data:",<<-E)
+ error_description.section("Invalid Request Data:", <<-E)
The data in your request was invalid (HTTP 400).
E
- error_description.section("Server Response:",format_rest_error)
+ error_description.section("Server Response:", format_rest_error)
end
def describe_406_error(error_description, response)
@@ -110,7 +110,7 @@ E
min_server_version = version_header["min_version"]
max_server_version = version_header["max_version"]
- error_description.section("Incompatible server API version:",<<-E)
+ error_description.section("Incompatible server API version:", <<-E)
This version of the API that this Chef request specified is not supported by the Chef server you sent this request to.
The server supports a min API version of #{min_server_version} and a max API version of #{max_server_version}.
Chef just made a request with an API version of #{client_api_version}.
@@ -122,18 +122,17 @@ E
end
def describe_500_error(error_description)
- error_description.section("Unknown Server Error:",<<-E)
+ error_description.section("Unknown Server Error:", <<-E)
The server had a fatal error attempting to load the node data.
E
error_description.section("Server Response:", format_rest_error)
end
def describe_503_error(error_description)
- error_description.section("Server Unavailable","The Chef Server is temporarily unavailable")
+ error_description.section("Server Unavailable", "The Chef Server is temporarily unavailable")
error_description.section("Server Response:", format_rest_error)
end
-
# Fallback for unexpected/uncommon http errors
def describe_http_error(error_description)
error_description.section("Unexpected API Request Failure:", format_rest_error)