mirror of https://github.com/codevalet/canary
Include OpenSSL::SSL::SSLError in the list of expected network related errors
Fixes #2
This commit is contained in:
parent
c4b5fe7c32
commit
ae45baa18f
|
@ -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
|
||||
|
|
|
@ -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 }
|
||||
|
|
Loading…
Reference in New Issue