summaryrefslogtreecommitdiffstats
path: root/lib/puppet/util/queue
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2009-05-12 22:12:45 -0500
committerJames Turnbull <james@lovedthanlost.net>2009-05-18 17:07:18 +1000
commit4bf2980577c2e1233b7102540237aae01c70bde5 (patch)
tree31ef01e4be4cce9c24420318288d1aeea35572c1 /lib/puppet/util/queue
parentf4cb8f36dfb2ae05d64ef609d03795537b0720fa (diff)
downloadpuppet-4bf2980577c2e1233b7102540237aae01c70bde5.tar.gz
puppet-4bf2980577c2e1233b7102540237aae01c70bde5.tar.xz
puppet-4bf2980577c2e1233b7102540237aae01c70bde5.zip
Protecting Stomp client against internal failures
Apparently the stomp client is really unhelpful with failures; this attempts to provide at least a bit more information. Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'lib/puppet/util/queue')
-rw-r--r--lib/puppet/util/queue/stomp.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/puppet/util/queue/stomp.rb b/lib/puppet/util/queue/stomp.rb
index 3a6a99ca2..62716fab2 100644
--- a/lib/puppet/util/queue/stomp.rb
+++ b/lib/puppet/util/queue/stomp.rb
@@ -21,7 +21,11 @@ class Puppet::Util::Queue::Stomp
raise ArgumentError, "Could not create Stomp client instance - queue source %s is not a Stomp URL: %s" % [Puppet[:queue_source], detail]
end
- self.stomp_client = Stomp::Client.new(uri.user, uri.password, uri.host, uri.port, true)
+ begin
+ self.stomp_client = Stomp::Client.new(uri.user, uri.password, uri.host, uri.port, true)
+ rescue => detail
+ raise ArgumentError, "Could not create Stomp client instance with queue source %s: got internal Stomp client error %s" % [Puppet[:queue_source], detail]
+ end
end
def send_message(target, msg)