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