diff options
author | Chris Wilson <chris@chrisjwilson.com> | 2017-05-18 16:20:16 +1000 |
---|---|---|
committer | Chris Wilson <chris@chrisjwilson.com> | 2017-05-23 15:19:08 +1000 |
commit | 8c07184250166cd206c0e6a9f5cf686b7de8f65d (patch) | |
tree | ee394f5bb477f4def9d0123bbf5b469072785bdd /app | |
parent | 39baadbd017a1e36cf95b0ad1a503015bd5e562f (diff) | |
download | gitlab-ce-8c07184250166cd206c0e6a9f5cf686b7de8f65d.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.
Diffstat (limited to 'app')
-rw-r--r-- | app/models/project_services/issue_tracker_service.rb | 2 | ||||
-rw-r--r-- | app/models/project_services/jira_service.rb | 2 |
2 files changed, 2 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 |