Skip to content

Commit

Permalink
Merge pull request #315 from zeari/standard_err
Browse files Browse the repository at this point in the history
catch standard error when watch stream finished
  • Loading branch information
Mooli Tayer authored Apr 11, 2018
2 parents ab99898 + fb7cb73 commit 359e8c1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/kubeclient/watch_stream.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def each
yield @formatter.call(line.chomp)
end
end
rescue IOError, Errno::EBADF
rescue StandardError
raise unless @finished
end

Expand Down
4 changes: 2 additions & 2 deletions test/test_watch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,10 @@ def test_watch_with_finish_and_ebadf
client = Kubeclient::Client.new(api_host, 'v1')
watcher = client.watch_events

# explodes when Errno::EBADF is not caught
# explodes when StandardError is not caught
watcher.each do
watcher.finish
raise Errno::EBADF
raise StandardError
end

assert_requested(:get, "#{api_host}/v1/watch/events", times: 1)
Expand Down

0 comments on commit 359e8c1

Please sign in to comment.