Commit 8c071842 authored by Chris Wilson's avatar Chris Wilson
Browse files

Rescue OpenSSL::SSL::SSLError in JiraService and IssueTrackerService

Add OpenSSL::SSL::SSLError to rescue in JiraService & IssueTrackerService. This
will prevent an exception in production and instead display
a message to the user.
parent a06562834a12
......@@ -76,7 +76,7 @@ def execute(data)
message = "#{self.type} received response #{response.code} when attempting to connect to #{self.project_url}"
result = true
end
rescue HTTParty::Error, Timeout::Error, SocketError, Errno::ECONNRESET, Errno::ECONNREFUSED => error
rescue HTTParty::Error, Timeout::Error, SocketError, Errno::ECONNRESET, Errno::ECONNREFUSED, OpenSSL::SSL::SSLError => error
message = "#{self.type} had an error when trying to connect to #{self.project_url}: #{error.message}"
end
Rails.logger.info(message)
......
......@@ -294,7 +294,7 @@ def noteable_name(noteable)
def jira_request
yield
rescue Timeout::Error, Errno::EINVAL, Errno::ECONNRESET, Errno::ECONNREFUSED, URI::InvalidURIError, JIRA::HTTPError => e
rescue Timeout::Error, Errno::EINVAL, Errno::ECONNRESET, Errno::ECONNREFUSED, URI::InvalidURIError, JIRA::HTTPError, OpenSSL::SSL::SSLError => e
Rails.logger.info "#{self.class.name} Send message ERROR: #{url} - #{e.message}"
nil
end
......
---
title: Rescue OpenSSL::SSL::SSLError in JiraService & IssueTrackerService
merge_request:
author:
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment