lib/apitool/client/apitool_client.rb in apitool-client-0.0.4 vs lib/apitool/client/apitool_client.rb in apitool-client-0.0.5
- old
+ new
@@ -22,10 +22,14 @@
def result
@result.nil? ? nil : @result.code.to_i
end
+ def errors
+
+ end
+
protected
def get_connection
@client ||= RestClient::Resource.new(
base_uri,
@@ -71,11 +75,11 @@
@response = _response
@request = _request
@result = _result
log = "#{result} - #{request[:method].upcase} - #{request[:url]} - payload[#{request[:payload] || ''}]"
- if response.present? and response.kind_of? Array and response[0].has_key?(:message)
- log = log + " - error[#{response[0][:message] || ''} | #{response[0][:details] || ''}]"
+ if response.present? and (response.kind_of? Array and response[0].has_key?(:message)) || (response.has_key?(:errors))
+ log = log + " - error['#{response.inspect}']"
end
logger.info log
end
def base_uri