diff options
author | Robert Speicher <robert@gitlab.com> | 2017-05-05 16:50:03 +0300 |
---|---|---|
committer | Robert Speicher <robert@gitlab.com> | 2017-05-05 16:50:03 +0300 |
commit | 10c1bf2d77fd0ab21309d0b136cbc0ac11f56c77 (patch) | |
tree | b171476c60bec5cacffbf1b65b09f83c8d6ce44f /lib | |
parent | faf2ce89cd4eafdccb78823cf1a32c338a8d9a79 (diff) | |
parent | 6eb9e981c61969a904ccbae2c5f52f562b02d199 (diff) |
Merge branch 'prometheus-integration-test-setting-fix' into 'master'
Added rescue block for the test method for the prometheus service
Closes #31451
See merge request !10994
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/prometheus.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/gitlab/prometheus.rb b/lib/gitlab/prometheus.rb index 62239779454..8827507955d 100644 --- a/lib/gitlab/prometheus.rb +++ b/lib/gitlab/prometheus.rb @@ -50,6 +50,12 @@ module Gitlab def get(url) handle_response(HTTParty.get(url)) + rescue SocketError + raise PrometheusError, "Can't connect to #{url}" + rescue OpenSSL::SSL::SSLError + raise PrometheusError, "#{url} contains invalid SSL data" + rescue HTTParty::Error + raise PrometheusError, "Network connection error" end def handle_response(response) |