diff options
author | Jose Ivan Vargas <jvargas@gitlab.com> | 2017-05-04 09:16:24 -0500 |
---|---|---|
committer | Jose Ivan Vargas <jvargas@gitlab.com> | 2017-05-04 18:35:53 -0500 |
commit | 6eb9e981c61969a904ccbae2c5f52f562b02d199 (patch) | |
tree | bff683eaedd5d763c39c1d4dd28307e377d92c8a | |
parent | 64e811957795293b647bda7aef23ffbd92082614 (diff) | |
download | gitlab-ce-prometheus-integration-test-setting-fix.tar.gz |
Improved changelog entry, also changed error message for HTTParty errorprometheus-integration-test-setting-fix
-rw-r--r-- | changelogs/unreleased/prometheus-integration-test-setting-fix.yml | 2 | ||||
-rw-r--r-- | lib/gitlab/prometheus.rb | 2 | ||||
-rw-r--r-- | spec/lib/gitlab/prometheus_spec.rb | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/changelogs/unreleased/prometheus-integration-test-setting-fix.yml b/changelogs/unreleased/prometheus-integration-test-setting-fix.yml index c65c682a114..45b7c2263e6 100644 --- a/changelogs/unreleased/prometheus-integration-test-setting-fix.yml +++ b/changelogs/unreleased/prometheus-integration-test-setting-fix.yml @@ -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: diff --git a/lib/gitlab/prometheus.rb b/lib/gitlab/prometheus.rb index aa9810c5c41..8827507955d 100644 --- a/lib/gitlab/prometheus.rb +++ b/lib/gitlab/prometheus.rb @@ -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) diff --git a/spec/lib/gitlab/prometheus_spec.rb b/spec/lib/gitlab/prometheus_spec.rb index 8e187df6ca4..fc453a2704b 100644 --- a/spec/lib/gitlab/prometheus_spec.rb +++ b/spec/lib/gitlab/prometheus_spec.rb @@ -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 |