Commit 6eb9e981 authored by Jose Ivan Vargas's avatar Jose Ivan Vargas

Improved changelog entry, also changed error message for HTTParty error

parent 64e81195
--- ---
title: Added rescue block for the test method title: Prevent 500 errors caused by testing the Prometheus service
merge_request: 10994 merge_request: 10994
author: author:
...@@ -55,7 +55,7 @@ module Gitlab ...@@ -55,7 +55,7 @@ module Gitlab
rescue OpenSSL::SSL::SSLError rescue OpenSSL::SSL::SSLError
raise PrometheusError, "#{url} contains invalid SSL data" raise PrometheusError, "#{url} contains invalid SSL data"
rescue HTTParty::Error rescue HTTParty::Error
raise PrometheusError, "An error has ocurred" raise PrometheusError, "Network connection error"
end end
def handle_response(response) def handle_response(response)
......
...@@ -73,7 +73,7 @@ describe Gitlab::Prometheus, lib: true do ...@@ -73,7 +73,7 @@ describe Gitlab::Prometheus, lib: true do
req_stub = stub_prometheus_request_with_exception(prometheus_url, HTTParty::Error) req_stub = stub_prometheus_request_with_exception(prometheus_url, HTTParty::Error)
expect { subject.send(:get, prometheus_url) } 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 expect(req_stub).to have_been_requested
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment