diff --git a/lib/apipie_bindings/api.rb b/lib/apipie_bindings/api.rb index c8dc57b..e8fa7b3 100644 --- a/lib/apipie_bindings/api.rb +++ b/lib/apipie_bindings/api.rb @@ -223,8 +223,8 @@ def http_call(http_method, path, params={}, headers={}, options={}) update_cache(response.headers[:apipie_checksum]) rescue => e clear_credentials if e.is_a? RestClient::Unauthorized - log.debug e.message + "\n" + - inspect_data(e.respond_to?(:response) ? process_data(e.response) : e) + log.error e.message + log.debug inspect_data(e) raise end end @@ -385,7 +385,10 @@ def process_data(response) end def inspect_data(obj) - ApipieBindings::Utils.inspect_data(obj) + ApipieBindings::Utils.inspect_data(obj.respond_to?(:response) ? process_data(obj.response) : obj) + rescue => e + log.debug "Error during inspecting response: #{e.message}" + '' end def create_fake_response(status, body, method, path, args=[])