Skip to content

Commit 5d3f21a

Browse files
committed
Revert "(SUP-5232) Added error handling to JSON conversion of metrics"
Conversion to JSON prior to making a HTTP request was not the error reported in SUP-5232. JSON responses that did not contain Array bodies were the cause of the issue. This reverts commit 05cf01b.
1 parent ce879ba commit 5d3f21a

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

files/pe_metrics.rb

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -79,16 +79,7 @@ def post_endpoint(url, body)
7979
end
8080

8181
def retrieve_additional_metrics(url, _metrics_type, metrics)
82-
begin
83-
json_data = metrics.to_json
84-
rescue StandardError => e
85-
STDERR.puts 'Failed to convert metrics to JSON.'
86-
STDERR.puts "Error: #{e.message}"
87-
STDERR.puts e.backtrace
88-
return []
89-
end
90-
91-
metrics_output = post_endpoint(url, json_data)
82+
metrics_output = post_endpoint(url, metrics.to_json)
9283
return [] if metrics_output.empty?
9384

9485
# For a status other than 200 or 404, add the HTTP code to the error array

0 commit comments

Comments
 (0)