Include OpenSSL::SSL::SSLError in the list of expected network related errors

Fixes #2
This commit is contained in:
R. Tyler Croy 2017-09-04 12:46:44 -07:00
parent c4b5fe7c32
commit ae45baa18f
No known key found for this signature in database
GPG Key ID: 1426C7DC3F51E16F
2 changed files with 12 additions and 0 deletions

View File

@ -1,6 +1,7 @@
require 'concurrent/hash'
require 'mini_cache'
require 'net/http'
require 'openssl'
module CodeValet
module Canary
@ -15,6 +16,7 @@ module CodeValet
Net::HTTPBadResponse,
Net::HTTPHeaderSyntaxError,
Net::ProtocolError,
OpenSSL::SSL::SSLError,
].freeze
# Access the caching object

View File

@ -1,6 +1,7 @@
require 'spec_helper'
require 'json'
require 'openssl'
require 'canary/dao/sentry'
@ -45,6 +46,15 @@ describe CodeValet::Canary::DAO::Sentry do
expect(subject.projects).to eql(projects)
end
end
# https://github.com/codevalet/canary/issues/2
it 'should gracefully handle OpenSSL errors' do
expect(SentryApi).to receive(:projects).and_raise(OpenSSL::SSL::SSLError)
expect(Raven).not_to receive(:capture_exception)
expect(subject.projects).to be_empty
expect(subject).to be_errored
end
end
it { should respond_to :issues_for }