client/lib/deltacloud/error_response.rb
# This method tries to parse the error XML from Deltacloud API
# In case there is no error returned in body, it will try to use
# the generic error reporting.
#
# - name    -> Deltacloud::Client::+Class+
# - error   -> Deltacloud XML error representation
# - message -> Exception message (overiden by error body message if
#              present)
#
This method tries to parse the error XML from Deltacloud API
In case there is no error returned in body, it will try to use
the generic error reporting.

name    -> Deltacloud::Client::+Class+
error   -> Deltacloud XML error representation
message -> Exception message (overiden by error body message if
present)
This method tries to parse the error XML from Deltacloud API In case there is no error returned in body it will try to use the generic error reporting . name - > Deltacloud :: Client :: + Class + error - > Deltacloud XML error representation message - > Exception message ( overiden by error body message if present )
def client_error(name, error, message=nil)
      args = {
        :message => message,
        :status => error ? error[:status] : '500'
      }
      if error and !error[:body].empty?
        if xml_error?(error)
          args.merge! parse_error(error[:body].to_xml.root)
        else
          args[:message] = error[:body]
        end
      end
      error(name).new(args)
    end
def client_error ( name , error , message = nil ) args = { :message => message , :status => error ? error [ :status ] : '500' } if error and ! error [ :body ] . empty? if xml_error? ( error ) args . merge! parse_error ( error [ :body ] . to_xml . root ) else args [ :message ] = error [ :body ] end end error ( name ) . new ( args ) end
This method tries to parse the error XML from Deltacloud API
In case there is no error returned in body, it will try to use
the generic error reporting.
This method tries to parse the error XML from Deltacloud API In case there is no error returned in body it will try to use the generic error reporting .
# If Deltacloud API sends an error in the response body, parse it. # Otherwise, when DC API sends just plain text error, use # it as the exception message. # If DC API does not send anything back, then fallback to # the 'message' attribute. #
name
<not_specific>
error
<not_specific>
message
<not_specific>