From 4bf2980577c2e1233b7102540237aae01c70bde5 Mon Sep 17 00:00:00 2001 From: Luke Kanies Date: Tue, 12 May 2009 22:12:45 -0500 Subject: 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 --- lib/puppet/util/queue/stomp.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib/puppet/util/queue') 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) -- cgit