Skip to content

Commit

Permalink
Do not catch exceptions when getting the updates list
Browse files Browse the repository at this point in the history
  • Loading branch information
teclator committed Feb 18, 2020
1 parent 7c13caf commit ea713fa
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
4 changes: 1 addition & 3 deletions src/lib/registration/registration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,7 @@ def get_updates_list
log.info "Reading available updates for product: #{product["name"]}"
remote_product = SwMgmt.remote_product(product)
updates = []
ConnectHelpers.catch_registration_errors do
updates = SUSE::Connect::YaST.list_installer_updates(remote_product, connect_params)
end
updates = SUSE::Connect::YaST.list_installer_updates(remote_product, connect_params)

log.info "Updates for '#{product["name"]}' are available at '#{updates}'"
updates
Expand Down
10 changes: 10 additions & 0 deletions test/registration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,16 @@
expect(subject.get_updates_list).to eq(updates)
end
end

context "when an exception connecting to the server occurs" do
before do
allow(suse_connect).to receive(:list_installer_updates).and_raise(Timeout::Error)
end

it "does not catch the error" do
expect { subject.get_updates_list }.to raise_error(Timeout::Error)
end
end
end

describe "#synchronize_products" do
Expand Down

0 comments on commit ea713fa

Please sign in to comment.