jabber_mirror: Exit if we fail to connect to the Jabber server

(imported from commit f5cc600325a3547412cf0b05239c988410354c10)
This commit is contained in:
Zev Benjamin 2014-02-28 14:00:03 -05:00
parent 52be065eda
commit 0d5d37a211

View file

@ -236,7 +236,10 @@ user and mirrors messages sent to Jabber rooms to Zulip.'''.replace("\n", " "))
xmpp = JabberToZulipBot(options.jabber_username, options.jabber_domain,
options.jabber_password, rooms,
openfire=options.openfire)
xmpp.connect(use_tls=not options.no_use_tls)
if not xmpp.connect(use_tls=not options.no_use_tls):
sys.exit("Unable to connect to Jabber server")
xmpp.set_zulip_client(zulip)
zulip.set_jabber_client(xmpp)