Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPawel Chojnacki <pawel@chojnacki.ws>2018-02-07 04:25:54 +0300
committerPawel Chojnacki <pawel@chojnacki.ws>2018-02-07 04:25:54 +0300
commit0e90284c11815f84c804e7e922e709b31ca6d029 (patch)
tree73c04b5accf3f317b36a9c1ca2f00b5454547d5a /lib/gitlab/prometheus_client.rb
parent5209689d956c727f784481c86fe61355385371f5 (diff)
Catch json parsing error as PrometheusError
Diffstat (limited to 'lib/gitlab/prometheus_client.rb')
-rw-r--r--lib/gitlab/prometheus_client.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/gitlab/prometheus_client.rb b/lib/gitlab/prometheus_client.rb
index 8264501b1ae..10527972663 100644
--- a/lib/gitlab/prometheus_client.rb
+++ b/lib/gitlab/prometheus_client.rb
@@ -42,6 +42,8 @@ module Gitlab
def json_api_get(type, args = {})
path = ['api', 'v1', type].join('/')
get(path, args)
+ rescue JSON::ParserError
+ raise PrometheusError, 'Parsing response failed'
rescue Errno::ECONNREFUSED
raise PrometheusError, 'Connection refused'
end