summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chrisjwilson.com>2017-05-18 16:20:16 +1000
committerChris Wilson <chris@chrisjwilson.com>2017-05-23 15:19:08 +1000
commit8c07184250166cd206c0e6a9f5cf686b7de8f65d (patch)
treeee394f5bb477f4def9d0123bbf5b469072785bdd
parent39baadbd017a1e36cf95b0ad1a503015bd5e562f (diff)
downloadgitlab-ce-mrchrisw-catch-openssl.tar.gz
Rescue OpenSSL::SSL::SSLError in JiraService and IssueTrackerServicemrchrisw-catch-openssl
Add OpenSSL::SSL::SSLError to rescue in JiraService & IssueTrackerService. This will prevent an exception in production and instead display a message to the user.
-rw-r--r--app/models/project_services/issue_tracker_service.rb2
-rw-r--r--app/models/project_services/jira_service.rb2
-rw-r--r--changelogs/unreleased/mrchrisw-catch-openssl.yml4
3 files changed, 6 insertions, 2 deletions
diff --git a/app/models/project_services/issue_tracker_service.rb b/app/models/project_services/issue_tracker_service.rb
index 50435b67eda..eddf308eae3 100644
--- a/app/models/project_services/issue_tracker_service.rb
+++ b/app/models/project_services/issue_tracker_service.rb
@@ -76,7 +76,7 @@ class IssueTrackerService < Service
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)
diff --git a/app/models/project_services/jira_service.rb b/app/models/project_services/jira_service.rb
index f388773efee..a91a986e195 100644
--- a/app/models/project_services/jira_service.rb
+++ b/app/models/project_services/jira_service.rb
@@ -294,7 +294,7 @@ class JiraService < IssueTrackerService
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
diff --git a/changelogs/unreleased/mrchrisw-catch-openssl.yml b/changelogs/unreleased/mrchrisw-catch-openssl.yml
new file mode 100644
index 00000000000..a8b433fb0cd
--- /dev/null
+++ b/changelogs/unreleased/mrchrisw-catch-openssl.yml
@@ -0,0 +1,4 @@
+---
+title: Rescue OpenSSL::SSL::SSLError in JiraService & IssueTrackerService
+merge_request:
+author: