Sure
When I have a testing strategy, I'll flatten the patch.
For any one reading this
rescue in Ruby is really rescue StardardError and Timeout::Error is not a
child, so it just falls through and unravels the stack.
On Thu, Oct 2, 2008 at 9:40 PM, Luke Kanies <[EMAIL PROTECTED]> wrote:
>
> On Oct 2, 2008, at 2:19 AM, Andrew Shafer wrote:
>
> >
> > First pass,
> > This class has little tests I can see.
> > Will discuss tomorrow
>
> Can you update this commit log with the reason for adding this extra
> rescue?
>
> The reasoning behind why this is necessary could be pretty instructive
> for others trying to catch timeout exceptions.
>
> >
> > Signed-off-by: Andrew Shafer <[EMAIL PROTECTED]>
> > ---
> > lib/puppet/network/xmlrpc/client.rb | 3 +++
> > 1 files changed, 3 insertions(+), 0 deletions(-)
> >
> > diff --git a/lib/puppet/network/xmlrpc/client.rb b/lib/puppet/
> > network/xmlrpc/client.rb
> > index e0fb5a0..946b191 100644
> > --- a/lib/puppet/network/xmlrpc/client.rb
> > +++ b/lib/puppet/network/xmlrpc/client.rb
> > @@ -74,6 +74,9 @@ module Puppet::Network
> > Puppet.warning "Other end went away;
> > restarting connection and retrying"
> > self.recycle_connection
> > retry
> > + rescue Timeout::Error => detail
> > + Puppet.err "Connection timeout: %s" %
> > [detail.to_s]
> > + raise XMLRPCClientError.new("Connection
> > Timeout").set_backtrace(detail.backtrace)
> > rescue => detail
> > if detail.message =~ /^Wrong size\. Was \d+,
> > should be \d+$/
> > Puppet.warning "XMLRPC returned wrong
> > size. Retrying."
> > --
> > 1.5.3.7
> >
> >
> > >
>
>
> --
> If all the world's a stage, I want to operate the trap door.
> -- Paul Beatty
> ---------------------------------------------------------------------
> Luke Kanies | http://reductivelabs.com | http://madstop.com
>
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Puppet Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/puppet-dev?hl=en
-~----------~----~----~----~------~----~------~--~---