lib/punchblock/console/cli.rb in punchblock-console-0.1.4 vs lib/punchblock/console/cli.rb in punchblock-console-0.1.5

- old
+ new

@@ -37,14 +37,18 @@ def run_client Thread.new do begin client.run - rescue Blather::Stream::ConnectionFailed - logger.error "The connection to the XMPP server failed. This could be due to a network failure or the server may not be started or accepting connections." - rescue => e - logger.error "Exception in Punchblock client thread! #{e.message}" - logger.error e.backtrace.join("\t\n") + rescue Punchblock::ProtocolError => e + case e.name + when 'Blather::Stream::ConnectionFailed' + puts "The connection to the XMPP server failed. This could be due to a network failure or the server may not be started or accepting connections." + $option_parser.parse '--help' + else + logger.error "Exception in Punchblock client thread! #{e.message}" + logger.error e.backtrace.join("\t\n") + end end end end def run_dispatcher