Skip to content

Commit

Permalink
use $DEBUG_API_CLIENT instead of $DEBUG for debugging request
Browse files Browse the repository at this point in the history
  • Loading branch information
syphax-bouazzouni committed Oct 18, 2023
1 parent 775c594 commit 169afb7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/ontologies_api_client/http.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 169afb7

Please sign in to comment.