Improved changelog entry, also changed error message for HTTParty error

This commit is contained in:
Jose Ivan Vargas 2017-05-04 09:16:24 -05:00
parent 64e8119577
commit 6eb9e981c6
3 changed files with 3 additions and 3 deletions

View File

@ -1,4 +1,4 @@
---
title: Added rescue block for the test method
title: Prevent 500 errors caused by testing the Prometheus service
merge_request: 10994
author:

View File

@ -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)

View File

@ -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