From 169afb7c1002f9db2b3276af36d552575cc80ba2 Mon Sep 17 00:00:00 2001 From: Syphax bouazzouni Date: Wed, 18 Oct 2023 04:24:05 +0200 Subject: [PATCH] use $DEBUG_API_CLIENT instead of $DEBUG for debugging request --- lib/ontologies_api_client/http.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/ontologies_api_client/http.rb b/lib/ontologies_api_client/http.rb index 8b736eb..ecb809c 100644 --- a/lib/ontologies_api_client/http.rb +++ b/lib/ontologies_api_client/http.rb @@ -61,7 +61,7 @@ def self.get(path, params = {}, options = {}) invalidate_cache = params.delete(:invalidate_cache) || false begin - puts "Getting: #{path} with #{params}" if $DEBUG + puts "Getting: #{path} with #{params}" if $DEBUG_API_CLIENT begin response = conn.get do |req| req.url path @@ -87,7 +87,7 @@ def self.get(path, params = {}, options = {}) obj = recursive_struct(load_json(response.body)) end rescue StandardError => e - puts "Problem getting #{path}" if $DEBUG + puts "Problem getting #{path}" if $DEBUG_API_CLIENT raise e end obj @@ -143,7 +143,7 @@ def self.patch(path, obj) end def self.delete(id) - puts "Deleting #{id}" if $DEBUG + puts "Deleting #{id}" if $DEBUG_API_CLIENT response = conn.delete id raise StandardError, response.body if response.status >= 500