Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions lib/active_campaign/errors.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,18 @@ def message
if response.nil?
super
else
<<~MESSAGE
STATUS: #{response.status}
URL: #{env.url}
REQUEST HEADERS: #{env.request_headers}
RESPONSE_HEADERS: #{env.response_headers}
REQUEST_BODY: #{env.request_body}\n\n"
RESPONSE_BODY: #{response.body}\n\n"
MESSAGE
begin
<<~MESSAGE
STATUS: #{response.try(:status)}
URL: #{env.url}
REQUEST HEADERS: #{env.request_headers}
RESPONSE_HEADERS: #{env.response_headers}
REQUEST_BODY: #{env.request_body}\n\n"
RESPONSE_BODY: #{response.body}\n\n"
MESSAGE
rescue StandardError => e

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ActiveCampaign::Error#message has the variable name 'e'

super
end
end
end

Expand Down
2 changes: 2 additions & 0 deletions lib/active_campaign/faraday/middleware/request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ def normalize_body(env)
logger.debug("Using body as is because group #{body}")
elsif body.key?(:list)
logger.debug("Using body as is because list #{body}")
elsif body.key?(:contacts) && body.key?(:callback)
logger.debug("Using body as is because contacts+callback #{body}")
else
body = transform_keys(body, :camelcase, :lower)
end
Expand Down