chef/lib/chef/formatters/error_inspectors/registration_error_inspector.rb
# Parses JSON from the error response sent by Chef Server and returns the
# error message
#--
# TODO: this code belongs in Chef::REST
Parses JSON from the error response sent by Chef Server and returns the
error message

this code belongs in Chef::REST
Parses JSON from the error response sent by Chef Server and returns the error message this code belongs in Chef :: REST
def format_rest_error
          Array(Chef::JSONCompat.from_json(exception.response.body)["error"]).join('; ')
        rescue Exception
          exception.response.body
        end
def format_rest_error Array ( Chef :: JSONCompat . from_json ( exception . response . body ) [ "error" ] ) . join ( '; ' ) rescue Exception exception . response . body end
Parses JSON from the error response sent by Chef Server and returns the
error message
Parses JSON from the error response sent by Chef Server and returns the error message