lib/zabbixapi/client.rb in zabbixapi-0.4.5 vs lib/zabbixapi/client.rb in zabbixapi-0.4.6
- old
+ new
@@ -61,10 +61,10 @@
end
def _request(body)
puts "[DEBUG] Send request: #{body}" if @options[:debug]
result = JSON.parse(http_request(body))
- raise "Server answer API error: #{result['error'].inspect} on request: #{body}" if result['error']
+ raise "Server answer API error:\n #{JSON.pretty_unparse(result['error'])}\n on request:\n #{JSON.pretty_unparse(JSON.parse(body))}" if result['error']
result['result']
end
def api_request(body)
_request message_json(body)