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