diff options
| author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-10-16 03:54:18 +0000 |
|---|---|---|
| committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-10-16 03:54:18 +0000 |
| commit | dad596e6c5e241607eee92e54890b53affeba02b (patch) | |
| tree | cacf10af8e832f5d3b7248dd6437465e6e23e317 /lib/puppet/networkclient.rb | |
| parent | 9a8636c3c22ca5b7d244e1a80e9c2bf8b4dffe8f (diff) | |
| download | puppet-dad596e6c5e241607eee92e54890b53affeba02b.tar.gz puppet-dad596e6c5e241607eee92e54890b53affeba02b.tar.xz puppet-dad596e6c5e241607eee92e54890b53affeba02b.zip | |
Fixing #291 -- the problem was that instead of throwing an error on a missing server, puppet was just exiting.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1785 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib/puppet/networkclient.rb')
| -rw-r--r-- | lib/puppet/networkclient.rb | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/lib/puppet/networkclient.rb b/lib/puppet/networkclient.rb index f093292f2..6284416e3 100644 --- a/lib/puppet/networkclient.rb +++ b/lib/puppet/networkclient.rb @@ -23,8 +23,8 @@ rescue LoadError => detail end module Puppet - class NetworkClientError < RuntimeError; end - class ClientError < RuntimeError; end + class NetworkClientError < Puppet::Error; end + class ClientError < Puppet::Error; end #--------------------------------------------------------------- if $noclientnetworking Puppet.err "Could not load client network libs: %s" % $noclientnetworking @@ -80,16 +80,17 @@ module Puppet [@host, @port] raise NetworkClientError, msg rescue SocketError => detail - Puppet.err "Could not find server %s" % @puppetserver - exit(12) + error = NetworkClientError.new( + "Could not find server %s" % @puppetserver + ) + error.set_backtrace detail.backtrace + raise error rescue => detail Puppet.err "Could not call %s.%s: %s" % [namespace, method, detail.inspect] - #raise NetworkClientError.new(detail.to_s) - if Puppet[:trace] - puts detail.backtrace - end - raise + error = NetworkClientError.new(detail.to_s) + error.set_backtrace detail.backtrace + raise error end } } |
