Method: Chef::Formatters::APIErrorFormatting#format_rest_error

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

#format_rest_errorObject

Parses JSON from the error response sent by Chef Server and returns the error message



145
146
147
148
149
# File 'lib/chef/formatters/error_inspectors/api_error_formatting.rb', line 145

def format_rest_error
  Array(Chef::JSONCompat.from_json(exception.response.body)["error"]).join("; ")
rescue Exception
  safe_format_rest_error
end