Issue 28836: Throw concurrent.futures.TimeoutError instead of concurrent.futures.__base.TimeoutError (original) (raw)
Here is my corouytine and the traceback on it to verify my issue too:
Task exception was never retrieved future: <Task finished coro=<VoiceBotCommands.__load() done, defined at E:\Users\Elsword\Desktop\DecoraterBot\Async\resources\Dependencies\DecoraterBotCore\commands\botvoicecommands.py:242> exception=TimeoutError()> Traceback (most recent call last): File "asyncio\tasks.py", line 239, in _step File "E:\Users\Elsword\Desktop\DecoraterBot\Async\resources\Dependencies\DecoraterBotCore\commands\botvoicecommands.py", line 257, in __load self.voice = yield from self.bot.join_voice_channel(self.vchannel) File "discord\client.py", line 3166, in join_voice_channel File "asyncio\tasks.py", line 396, in wait_for concurrent.futures._base.TimeoutError
@async
def __load(self):
"""
Makes bot able to join a voice channel when the commands are loaded.
"""
try:
vchannel_2 = str(self.botvoicechannel['Bot_Current_Voice_Channel'][0])
vmserver = str(self.botvoicechannel['Bot_Current_Voice_Channel'][1])
vmchannel = str(self.botvoicechannel['Bot_Current_Voice_Channel'][2])
self.voice_message_server_name = str(self.botvoicechannel['Bot_Current_Voice_Channel'][3])
self.vchannel_name = str(self.botvoicechannel['Bot_Current_Voice_Channel'][4])
self.vchannel = discord.Object(id=vchannel_2)
self.voice_message_server = discord.Object(id=vmserver)
self.voice_message_channel = discord.Object(id=vmchannel)
try:
self.voice = yield from self.bot.join_voice_channel(self.vchannel)
self.verror = False
except discord.errors.ConnectionClosed:
pass
except discord.errors.InvalidArgument:
self.voice_message_server_name = None
self.vchannel_name = None
self.vchannel = None
self.voice_message_server = None
self.voice_message_channel = None
self.voice = None
self.verror = True
except BotErrors.CommandTimeoutError:
yield from self.bot.send_message(self.voice_message_channel,
content=str(
self.bot.botmessages['reload_commands_voice_channels_bypass2'][0]))
self.voice_message_server_name = None
self.vchannel_name = None
self.vchannel = None
self.voice_message_server = None
self.voice_message_channel = None
self.voice = None
self.verror = True
except RuntimeError:
self.voice_message_server_name = None
self.vchannel_name = None
self.vchannel = None
self.voice_message_server = None
self.voice = None
self.verror = True
msgdata = str(self.bot.botmessages['reload_commands_voice_channels_bypass2'][1])
yield from self.bot.send_message(self.voice_message_channel, content=msgdata)
self.voice_message_channel = None
if self.verror is not True:
message_data = str(self.bot.botmessages['reload_commands_voice_channels_bypass2'][2]).format(
self.vchannel_name)
yield from self.bot.send_message(self.voice_message_channel, content=message_data)
except IndexError:
self.voice_message_server_name = None
self.vchannel_name = None
self.vchannel = None
self.voice_message_server = None
self.voice_message_channel = None
self.voice = None
except discord.errors.ClientException:
pass # already in a voice channel so lots not set those values to None.