diff options
author | Jose Ivan Vargas <jvargas@gitlab.com> | 2017-04-28 15:20:58 -0500 |
---|---|---|
committer | Jose Ivan Vargas <jvargas@gitlab.com> | 2017-05-04 13:56:26 -0500 |
commit | ad6ac17c5434f7eb87005dc3603b4ae9409c333f (patch) | |
tree | 9a2a976da09bece8ef6e4c418f55c4535d9334ae /lib | |
parent | 91e8f7702c7781ee8ccbbe9338500e616606af29 (diff) | |
download | gitlab-ce-ad6ac17c5434f7eb87005dc3603b4ae9409c333f.tar.gz |
Added rescue block for the test method for the prometheus service
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/prometheus.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/gitlab/prometheus.rb b/lib/gitlab/prometheus.rb index 62239779454..37afec5e7df 100644 --- a/lib/gitlab/prometheus.rb +++ b/lib/gitlab/prometheus.rb @@ -49,7 +49,11 @@ module Gitlab end def get(url) - handle_response(HTTParty.get(url)) + begin + handle_response(HTTParty.get(url)) + rescue SocketError + raise PrometheusError, "Can't connect to #{url}" + end end def handle_response(response) |