Skip to content
Snippets Groups Projects
Commit 6eb9e981 authored by Jose Ivan Vargas Lopez's avatar Jose Ivan Vargas Lopez
Browse files

Improved changelog entry, also changed error message for HTTParty error

parent 64e81195
No related branches found
No related tags found
1 merge request!10994Added rescue block for the test method for the prometheus service
Pipeline #
---
title: Added rescue block for the test method
title: Prevent 500 errors caused by testing the Prometheus service
merge_request: 10994
author:
Loading
Loading
@@ -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)
Loading
Loading
Loading
Loading
@@ -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
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment