Skip to content
This repository has been archived by the owner on Feb 6, 2024. It is now read-only.

Commit

Permalink
Merge pull request #119 from soupmatt/handle_network_timeouts_on_sign…
Browse files Browse the repository at this point in the history
…_out_notifications

Handle Errno::ETIMEOUT when sending single sign out notifications
  • Loading branch information
pencil committed Jul 25, 2015
2 parents b92632e + 5951e10 commit 31a26fe
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def send_notification(url, xml)
Rails.logger.warn "Service #{url} responded to logout notification with code '#{result.status}'!"
false
end
rescue Faraday::Error::ClientError => error
rescue Faraday::Error::ClientError, Errno::ETIMEDOUT => error
Rails.logger.warn "Failed to send logout notification to service #{url} due to #{error}"
false
end
Expand Down
12 changes: 11 additions & 1 deletion spec/model/service_ticket/single_sign_out_notifier_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,16 @@
notifier.notify.should == false
end
end

context 'network timeout' do
before(:each) do
stub_request(:post, service).to_raise Errno::ETIMEDOUT
end

it 'returns false' do
notifier.notify.should == false
end
end
end
end
end
end

0 comments on commit 31a26fe

Please sign in to comment.