Add logging to failed subscriptions.
This commit is contained in:
@@ -97,18 +97,23 @@ class TrackerComponent(cmds.Component):
|
||||
|
||||
responses = []
|
||||
for sub in subs:
|
||||
if self.bot.using_webhooks:
|
||||
resp = await self.bot.subscribe_webhook(sub)
|
||||
else:
|
||||
resp = await self.bot.subscribe_websocket(sub)
|
||||
responses.append(resp)
|
||||
try:
|
||||
if self.bot.using_webhooks:
|
||||
resp = await self.bot.subscribe_webhook(sub)
|
||||
else:
|
||||
resp = await self.bot.subscribe_websocket(sub)
|
||||
responses.append(resp)
|
||||
except Exception:
|
||||
logger.exception("Failed to subscribe to %s", str(sub))
|
||||
for sub in usersubs:
|
||||
if self.bot.using_webhooks:
|
||||
resp = await self.bot.subscribe_webhook(sub)
|
||||
else:
|
||||
resp = await self.bot.subscribe_websocket(sub, token_for=channel.userid)
|
||||
responses.append(resp)
|
||||
|
||||
try:
|
||||
if self.bot.using_webhooks:
|
||||
resp = await self.bot.subscribe_webhook(sub)
|
||||
else:
|
||||
resp = await self.bot.subscribe_websocket(sub, token_for=channel.userid, as_bot=False)
|
||||
responses.append(resp)
|
||||
except Exception:
|
||||
logger.exception("Failed to subscribe to %s", str(sub))
|
||||
|
||||
logger.info("Finished tracker subscription to %s: %s", channel.userid, ', '.join(map(str, responses)))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user