Skip to content

Commit f451140

Browse files
committed
Add warning log on conduit generation with initial subscription errors.
1 parent 86f0826 commit f451140

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

twitchio/client.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3538,7 +3538,20 @@ async def _generate_new_conduit(self) -> Conduit:
35383538
# Maybe need an additional bool; will need feedback?
35393539
if self._initial_subs:
35403540
logger.info("Attempting to do an initial subscription on new conduit: %r.", self._conduit_info)
3541-
await self._multi_sub(self._initial_subs, stop_on_error=False)
3541+
payload = await self._multi_sub(self._initial_subs, stop_on_error=False)
3542+
3543+
errors: int = 0
3544+
for data in payload.errors:
3545+
if data.error.status != 409:
3546+
errors += 1
3547+
3548+
if errors:
3549+
msg = (
3550+
"An error(s) occurred during subscriptions to %r: %d/%d subscriptions failed. Check the users have"
3551+
"been properly authorized. You can safely ignore this warning if you plan to authorize and subscribe later."
3552+
)
3553+
logger.warning(msg, self._conduit_info, errors, len(self._initial_subs))
3554+
35423555
self._subbed = True
35433556

35443557
return new

0 commit comments

Comments
 (0)