提交 6eb9e981 编写于 作者: J Jose Ivan Vargas

Improved changelog entry, also changed error message for HTTParty error

上级 64e81195
---
title: Added rescue block for the test method
title: Prevent 500 errors caused by testing the Prometheus service
merge_request: 10994
author:
......@@ -55,7 +55,7 @@ module Gitlab
rescue OpenSSL::SSL::SSLError
raise PrometheusError, "#{url} contains invalid SSL data"
rescue HTTParty::Error
raise PrometheusError, "An error has ocurred"
raise PrometheusError, "Network connection error"
end
def handle_response(response)
......
......@@ -73,7 +73,7 @@ describe Gitlab::Prometheus, lib: true do
req_stub = stub_prometheus_request_with_exception(prometheus_url, HTTParty::Error)
expect { subject.send(:get, prometheus_url) }
.to raise_error(Gitlab::PrometheusError, "An error has ocurred")
.to raise_error(Gitlab::PrometheusError, "Network connection error")
expect(req_stub).to have_been_requested
end
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册