Generates human-friendly explanations for errors encountered during cookbook sync.
# File lib/chef/formatters/error_inspectors/cookbook_sync_error_inspector.rb, line 42 def add_explanation(error_description) case exception when *NETWORK_ERROR_CLASSES describe_network_errors(error_description) when Net::HTTPServerException, Net::HTTPFatalError humanize_http_exception(error_description) else error_description.section("Unexpected Error:","#{exception.class.name}: #{exception.message}") end end
# File lib/chef/formatters/error_inspectors/cookbook_sync_error_inspector.rb, line 53 def config Chef::Config end
# File lib/chef/formatters/error_inspectors/cookbook_sync_error_inspector.rb, line 57 def humanize_http_exception(error_description) response = exception.response case response when Net::HTTPUnauthorized # TODO: this is where you'd see conflicts b/c of username/clientname stuff describe_401_error(error_description) when Net::HTTPBadRequest describe_400_error(error_description) when Net::HTTPNotFound when Net::HTTPInternalServerError describe_500_error(error_description) when Net::HTTPBadGateway, Net::HTTPServiceUnavailable describe_503_error(error_description) else describe_http_error(error_description) end end
Generated with the Darkfish Rdoc Generator 2.