From aec9328843aa3c50b2dec1097c7f1cda75b187b2 Mon Sep 17 00:00:00 2001 From: hspazio Date: Thu, 2 Feb 2017 17:47:25 +0000 Subject: [PATCH] add full response body to ruby_outlook_response result key --- lib/ruby_outlook.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/ruby_outlook.rb b/lib/ruby_outlook.rb index d71717d..3558241 100644 --- a/lib/ruby_outlook.rb +++ b/lib/ruby_outlook.rb @@ -78,7 +78,10 @@ def make_api_call(method, url, token, params = nil, payload = nil) end if response.status >= 300 - return JSON.dump({ 'ruby_outlook_error' => response.status}) + error_info = response.body.empty? ? '' : JSON.parse(response.body) + return JSON.dump({ + 'ruby_outlook_error' => response.status, + 'ruby_outlook_response' => error_info }) end response.body