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 'concurrent/hash'
|
||||||
require 'mini_cache'
|
require 'mini_cache'
|
||||||
require 'net/http'
|
require 'net/http'
|
||||||
|
require 'openssl'
|
||||||
|
|
||||||
module CodeValet
|
module CodeValet
|
||||||
module Canary
|
module Canary
|
||||||
|
@ -15,6 +16,7 @@ module CodeValet
|
||||||
Net::HTTPBadResponse,
|
Net::HTTPBadResponse,
|
||||||
Net::HTTPHeaderSyntaxError,
|
Net::HTTPHeaderSyntaxError,
|
||||||
Net::ProtocolError,
|
Net::ProtocolError,
|
||||||
|
OpenSSL::SSL::SSLError,
|
||||||
].freeze
|
].freeze
|
||||||
|
|
||||||
# Access the caching object
|
# Access the caching object
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
require 'json'
|
require 'json'
|
||||||
|
require 'openssl'
|
||||||
|
|
||||||
require 'canary/dao/sentry'
|
require 'canary/dao/sentry'
|
||||||
|
|
||||||
|
@ -45,6 +46,15 @@ describe CodeValet::Canary::DAO::Sentry do
|
||||||
expect(subject.projects).to eql(projects)
|
expect(subject.projects).to eql(projects)
|
||||||
end
|
end
|
||||||
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
|
end
|
||||||
|
|
||||||
it { should respond_to :issues_for }
|
it { should respond_to :issues_for }
|
||||||
|
|
Loading…
Reference in New Issue