Skip to content

Commit

Permalink
Add logging to Cloudflare client
Browse files Browse the repository at this point in the history
  • Loading branch information
tra0x committed Nov 21, 2024
1 parent e924f49 commit b853e41
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions lib/record_store/provider/cloudflare/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,35 +11,30 @@ def initialize(api_token)

def get(endpoint, params = {})
uri = build_uri(endpoint, params)

response = request(:get, uri)
Cloudflare::Response.new(response)
end

def post(endpoint, body = nil)
uri = build_uri(endpoint)

response = request(:post, uri, body: body)
Cloudflare::Response.new(response)
end

def put(endpoint, body = nil)
uri = build_uri(endpoint)

response = request(:put, uri, body: body)
Cloudflare::Response.new(response)
end

def patch(endpoint, body = nil)
uri = build_uri(endpoint)

response = request(:patch, uri, body: body)
Cloudflare::Response.new(response)
end

def delete(endpoint)
uri = build_uri(endpoint)

response = request(:delete, uri)
Cloudflare::Response.new(response)
end
Expand Down Expand Up @@ -70,9 +65,9 @@ def request(method, uri, body: nil)
begin
response = conn.request(request)
rescue StandardError => e
$stderr.puts "HTTP error: #{e.message}"
raise "HTTP error: #{e.message}"
end
response
end
end

Expand Down

0 comments on commit b853e41

Please sign in to comment.