def retry_exceptions(options={})
connection_errors = DEFAULT_CONNECTION_ERRORS.merge(options[:connection_exceptions] || {})
retry_errors = DEFAULT_RETRY_ERRORS.merge(options[:retriable_exceptions] || {})
retry_network_exceptions(options) do
begin
yield
rescue *retry_errors.keys => e
raise ActiveUtils::RetriableConnectionError, derived_error_message(retry_errors, e.class)
rescue OpenSSL::X509::CertificateError => e
NetworkConnectionRetries.log(options[:logger], :error, e.message, options[:tag])
raise ActiveUtils::ClientCertificateError, "The remote server did not accept the provided SSL certificate"
rescue Zlib::BufError => e
raise ActiveUtils::InvalidResponseError, "The remote server replied with an invalid response"
rescue *connection_errors.keys => e
raise ActiveUtils::ConnectionError, derived_error_message(connection_errors, e.class)
end
end
end