lib/pact_broker/badges/service.rb in pact_broker-2.42.0 vs lib/pact_broker/badges/service.rb in pact_broker-2.43.0

- old
+ new

@@ -82,11 +82,14 @@ return nil unless PactBroker.configuration.shields_io_base_url uri = build_uri(left_text, right_text, color) begin response = do_request(uri) response.code == '200' ? response.body : nil + rescue Net::OpenTimeout => e + logger.warn "Timeout retrieving badge from #{uri} #{e.class} - #{e.message}" + nil rescue StandardError => e - logger.error "Error retrieving badge from #{uri} due to #{e.class} - #{e.message}" + log_error e, "Error retrieving badge from #{uri}" nil end end def build_uri left_text, right_text, color