Skip to content

Commit de40005

Browse files
orientorshowell
authored andcommitted
bridge_with_irc: Improve user-friendliness.
Edit error and success messages of zulip-irc bridge to be more user friendly.
1 parent 87b57f8 commit de40005

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

zulip/integrations/bridge_with_irc/irc_mirror_backend.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,18 @@ def connect(self, *args, **kwargs):
3535
self.reactor.loop.run_until_complete(
3636
self.connection.connect(*args, **kwargs)
3737
)
38-
print("Connected to IRC server.")
38+
print("Listening now. Please send an IRC message to verify operation")
3939

4040
def check_subscription_or_die(self):
4141
# type: () -> None
4242
resp = self.zulip_client.list_subscriptions()
43-
assert resp["result"] == "success"
43+
if resp["result"] != "success":
44+
print("ERROR: %s" % (resp["msg"],))
45+
exit(1)
4446
subs = [s["name"] for s in resp["subscriptions"]]
4547
if self.stream not in subs:
46-
raise Exception("The bot is not yet subscribed to the specified stream")
48+
print("The bot is not yet subscribed to stream '%s'. Please subscribe the bot to the stream first." % (self.stream,))
49+
exit(1)
4750

4851
def on_nicknameinuse(self, c, e):
4952
# type: (ServerConnection, Event) -> None

0 commit comments

Comments
 (0)