diff options
author | Markus Roberts <Markus@reality.com> | 2010-01-24 18:32:25 -0800 |
---|---|---|
committer | Markus Roberts <Markus@reality.com> | 2010-01-24 18:32:25 -0800 |
commit | 0025e13792b6a8e010ce1fd1dc20a17e7ba8af53 (patch) | |
tree | 5715206a2db5717adb7077ff786541906b8fde28 | |
parent | bfc9e45309abd182aac99a7dbf8960540fc05bf6 (diff) | |
download | puppet-0025e13792b6a8e010ce1fd1dc20a17e7ba8af53.tar.gz puppet-0025e13792b6a8e010ce1fd1dc20a17e7ba8af53.tar.xz puppet-0025e13792b6a8e010ce1fd1dc20a17e7ba8af53.zip |
Partial reversion of patch for #3088 to fix #3104 (Exception misreported)
In my patch for #3088 I made a erroneous assumption about the ruby exception
hierarchy and thus missed the fact that Timeout::error descends from both
SignalError and Interrupt. This is a partial reversion of the patch for #3088
to let these through so that more useful error messages can be produced.
-rw-r--r-- | lib/puppet/agent.rb | 4 | ||||
-rw-r--r-- | lib/puppet/configurer.rb | 4 | ||||
-rw-r--r-- | lib/puppet/configurer/fact_handler.rb | 2 | ||||
-rw-r--r-- | lib/puppet/configurer/plugin_handler.rb | 2 | ||||
-rw-r--r-- | lib/puppet/indirector/facts/facter.rb | 2 | ||||
-rw-r--r-- | lib/puppet/indirector/ldap.rb | 2 | ||||
-rw-r--r-- | lib/puppet/network/http/handler.rb | 2 | ||||
-rw-r--r-- | lib/puppet/network/xmlrpc/client.rb | 2 | ||||
-rw-r--r-- | lib/puppet/provider/augeas/augeas.rb | 4 | ||||
-rw-r--r-- | lib/puppet/ssl/host.rb | 2 | ||||
-rw-r--r-- | lib/puppet/util/autoload.rb | 4 | ||||
-rw-r--r-- | lib/puppet/util/feature.rb | 2 |
12 files changed, 16 insertions, 16 deletions
diff --git a/lib/puppet/agent.rb b/lib/puppet/agent.rb index 5dbb15227..c188719ba 100644 --- a/lib/puppet/agent.rb +++ b/lib/puppet/agent.rb @@ -51,7 +51,7 @@ class Puppet::Agent with_client do |client| begin sync.synchronize { lock { client.run(*args) } } - rescue SystemExit,NoMemoryError,SignalException,Interrupt + rescue SystemExit,NoMemoryError raise rescue Exception => detail puts detail.backtrace if Puppet[:trace] @@ -124,7 +124,7 @@ class Puppet::Agent def with_client begin @client = client_class.new - rescue SystemExit,NoMemoryError,SignalException,Interrupt + rescue SystemExit,NoMemoryError raise rescue Exception => detail puts detail.backtrace if Puppet[:trace] diff --git a/lib/puppet/configurer.rb b/lib/puppet/configurer.rb index 56217d658..61c6f0251 100644 --- a/lib/puppet/configurer.rb +++ b/lib/puppet/configurer.rb @@ -105,7 +105,7 @@ class Puppet::Configurer duration = thinmark do result = catalog_class.find(name, fact_options.merge(:ignore_cache => true)) end - rescue SystemExit,NoMemoryError,SignalException,Interrupt + rescue SystemExit,NoMemoryError raise rescue Exception => detail puts detail.backtrace if Puppet[:trace] @@ -150,7 +150,7 @@ class Puppet::Configurer def run(options = {}) begin prepare() - rescue SystemExit,NoMemoryError,SignalException,Interrupt + rescue SystemExit,NoMemoryError raise rescue Exception => detail puts detail.backtrace if Puppet[:trace] diff --git a/lib/puppet/configurer/fact_handler.rb b/lib/puppet/configurer/fact_handler.rb index a05d89060..72bd76e1f 100644 --- a/lib/puppet/configurer/fact_handler.rb +++ b/lib/puppet/configurer/fact_handler.rb @@ -17,7 +17,7 @@ module Puppet::Configurer::FactHandler begin reload_facter() Puppet::Node::Facts.find(Puppet[:certname]) - rescue SystemExit,NoMemoryError,SignalException,Interrupt + rescue SystemExit,NoMemoryError raise rescue Exception => detail puts detail.backtrace if Puppet[:trace] diff --git a/lib/puppet/configurer/plugin_handler.rb b/lib/puppet/configurer/plugin_handler.rb index 856942176..9e1c113f9 100644 --- a/lib/puppet/configurer/plugin_handler.rb +++ b/lib/puppet/configurer/plugin_handler.rb @@ -19,7 +19,7 @@ module Puppet::Configurer::PluginHandler begin Puppet.info "Loading downloaded plugin %s" % file load file - rescue SystemExit,NoMemoryError,SignalException,Interrupt + rescue SystemExit,NoMemoryError raise rescue Exception => detail Puppet.err "Could not load downloaded file %s: %s" % [file, detail] diff --git a/lib/puppet/indirector/facts/facter.rb b/lib/puppet/indirector/facts/facter.rb index 2caeeede2..b5787ddf6 100644 --- a/lib/puppet/indirector/facts/facter.rb +++ b/lib/puppet/indirector/facts/facter.rb @@ -29,7 +29,7 @@ class Puppet::Node::Facts::Facter < Puppet::Indirector::Code Timeout::timeout(self.timeout) do load file end - rescue SystemExit,NoMemoryError,SignalException,Interrupt + rescue SystemExit,NoMemoryError raise rescue Exception => detail Puppet.warning "Could not load fact file %s: %s" % [fqfile, detail] diff --git a/lib/puppet/indirector/ldap.rb b/lib/puppet/indirector/ldap.rb index 31ee0e020..ab3c7ef54 100644 --- a/lib/puppet/indirector/ldap.rb +++ b/lib/puppet/indirector/ldap.rb @@ -40,7 +40,7 @@ class Puppet::Indirector::Ldap < Puppet::Indirector::Terminus found = true yield entry end - rescue SystemExit,NoMemoryError,SignalException,Interrupt + rescue SystemExit,NoMemoryError raise rescue Exception => detail if count == 0 diff --git a/lib/puppet/network/http/handler.rb b/lib/puppet/network/http/handler.rb index 4d9634f79..444fbf7e7 100644 --- a/lib/puppet/network/http/handler.rb +++ b/lib/puppet/network/http/handler.rb @@ -66,7 +66,7 @@ module Puppet::Network::HTTP::Handler check_authorization(indirection_request) send("do_%s" % indirection_request.method, indirection_request, request, response) - rescue SystemExit,NoMemoryError,SignalException,Interrupt + rescue SystemExit,NoMemoryError raise rescue Exception => e return do_exception(response, e) diff --git a/lib/puppet/network/xmlrpc/client.rb b/lib/puppet/network/xmlrpc/client.rb index 805d99324..9faa71c8b 100644 --- a/lib/puppet/network/xmlrpc/client.rb +++ b/lib/puppet/network/xmlrpc/client.rb @@ -144,7 +144,7 @@ module Puppet::Network Puppet.debug "Calling %s.%s" % [namespace, method] begin call("%s.%s" % [namespace, method.to_s],*args) - rescue SystemExit,NoMemoryError,SignalException,Interrupt + rescue SystemExit,NoMemoryError raise rescue Exception => detail retry if self.class.error_handler(detail).execute(self, detail, namespace, method) == :retry diff --git a/lib/puppet/provider/augeas/augeas.rb b/lib/puppet/provider/augeas/augeas.rb index 748c84e7d..8dccb4e9d 100644 --- a/lib/puppet/provider/augeas/augeas.rb +++ b/lib/puppet/provider/augeas/augeas.rb @@ -254,7 +254,7 @@ Puppet::Type.type(:augeas).provide(:augeas) do when "get"; return_value = process_get(cmd_array) when "match"; return_value = process_match(cmd_array) end - rescue SystemExit,NoMemoryError,SignalException,Interrupt + rescue SystemExit,NoMemoryError raise rescue Exception => e fail("Error sending command '#{command}' with params #{cmd_array[1..-1].inspect}/#{e.message}") @@ -337,7 +337,7 @@ Puppet::Type.type(:augeas).provide(:augeas) do aug.insert(path, label, before) else fail("Command '#{command}' is not supported") end - rescue SystemExit,NoMemoryError,SignalException,Interrupt + rescue SystemExit,NoMemoryError raise rescue Exception => e fail("Error sending command '#{command}' with params #{cmd_array.inspect}/#{e.message}") diff --git a/lib/puppet/ssl/host.rb b/lib/puppet/ssl/host.rb index d6bbc4e5d..7d34a4fde 100644 --- a/lib/puppet/ssl/host.rb +++ b/lib/puppet/ssl/host.rb @@ -220,7 +220,7 @@ class Puppet::SSL::Host return if certificate generate return if certificate - rescue SystemExit,NoMemoryError,SignalException,Interrupt + rescue SystemExit,NoMemoryError raise rescue Exception => detail Puppet.err "Could not request certificate: %s" % detail.to_s diff --git a/lib/puppet/util/autoload.rb b/lib/puppet/util/autoload.rb index 142ff293f..51fdaadad 100644 --- a/lib/puppet/util/autoload.rb +++ b/lib/puppet/util/autoload.rb @@ -86,7 +86,7 @@ class Puppet::Util::Autoload name = symbolize(name) loaded name, file return true - rescue SystemExit,NoMemoryError,SignalException,Interrupt + rescue SystemExit,NoMemoryError raise rescue Exception => detail # I have no idea what's going on here, but different versions @@ -125,7 +125,7 @@ class Puppet::Util::Autoload begin Kernel.require file loaded(name, file) - rescue SystemExit,NoMemoryError,SignalException,Interrupt + rescue SystemExit,NoMemoryError raise rescue Exception => detail if Puppet[:trace] diff --git a/lib/puppet/util/feature.rb b/lib/puppet/util/feature.rb index 8f77a2724..6218eabf4 100644 --- a/lib/puppet/util/feature.rb +++ b/lib/puppet/util/feature.rb @@ -83,7 +83,7 @@ class Puppet::Util::Feature begin require lib - rescue SystemExit,NoMemoryError,SignalException,Interrupt + rescue SystemExit,NoMemoryError raise rescue Exception Puppet.debug "Failed to load library '%s' for feature '%s'" % [lib, name] |