Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

exception is in block in docs, but not in code #3

Merged
merged 1 commit into from
Jun 2, 2012

Conversation

adsummos
Copy link

@adsummos adsummos commented Jun 1, 2012

Added the exception to the block and made StandardError the default. Also, catching Exception by default is not a good idea because it prevents things like ctrl-c

nfedyashev pushed a commit that referenced this pull request Jun 2, 2012
exception is in block in docs, but not in code
@nfedyashev nfedyashev merged commit eaec7ae into nfedyashev:master Jun 2, 2012
@nfedyashev
Copy link
Owner

Thanks a lot!

@nfedyashev
Copy link
Owner

What do you think about b2c859c ?

Without this edge case handling ctrl-chandling is not possible. SignalException(http://blog.nicksieger.com/articles/2006/09/06/rubys-exception-hierarchy) raised while sleeping was trapped otherwise.

retryable(:sleep => 20, :on => [ SignalException ], :tries => 30) do
  puts 'started!'

  puts 'press ctrl-c now'
  sleep 3
end

Does this make sense?

@adsummos
Copy link
Author

adsummos commented Jun 2, 2012

makes sense to me

@nfedyashev
Copy link
Owner

awesome. Pushing new version to the rubygems

nfedyashev added a commit that referenced this pull request Jul 14, 2016
exception is in block in docs, but not in code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants