Skip to content

Commit aeaf220

Browse files
committed
Fixed error handling from Redcap client requests - fixes #731
1 parent a951309 commit aeaf220

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

app/models/redcap/api_client.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,9 +269,11 @@ def request(action, force_reload: nil, request_options: nil)
269269
end
270270
res
271271
rescue StandardError => e
272+
r_code = response_code
273+
r_body = res
272274
Rails.logger.error "Redcap::ApiClient request failed for action '#{action}' - #{e} - " \
273-
"code: #{e.response.code} - body: #{e.response.body} - " \
274-
"with request options: #{request_options}"
275+
"with request options: #{request_options} - " \
276+
"code: #{r_code} - body: #{r_body}"
275277
raise
276278
end
277279

0 commit comments

Comments
 (0)