You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running !list on spotty internet, the download can time out and give an unhandled TimeoutError. We may even want to notify the user in Discord that some files failed to download when the list appears
Interestingly, Nextcord documentation claims that Attachment.save() will only raise either nextcord.HttpException or nextcord.NotFound, so this might be case of lacking documentation on their part as well.
Task exception was never retrieved
future: <Task finished name='Task-45' coro=<scrape_channel_media.<locals>.dl_file() done, defined at /home/jack/Repos/busty/main
Traceback (most recent call last):
File "/home/jack/Repos/busty/main.py", line 722, in dl_file
await attachment.save(attachment_filepath)
File "/home/jack/Repos/busty/env/lib/python3.10/site-packages/nextcord/message.py", line 225, in save
data = await self.read(use_cached=use_cached)
File "/home/jack/Repos/busty/env/lib/python3.10/site-packages/nextcord/message.py", line 267, in read
data = await self._http.get_from_cdn(url)
File "/home/jack/Repos/busty/env/lib/python3.10/site-packages/nextcord/http.py", line 359, in get_from_cdn
return await resp.read()
File "/home/jack/Repos/busty/env/lib/python3.10/site-packages/aiohttp/client_reqrep.py", line 1036, in read
self._body = await self.content.read()
File "/home/jack/Repos/busty/env/lib/python3.10/site-packages/aiohttp/streams.py", line 375, in read
block = await self.readany()
File "/home/jack/Repos/busty/env/lib/python3.10/site-packages/aiohttp/streams.py", line 397, in readany
await self._wait("readany")
File "/home/jack/Repos/busty/env/lib/python3.10/site-packages/aiohttp/streams.py", line 303, in _wait
with self._timer:
File "/home/jack/Repos/busty/env/lib/python3.10/site-packages/aiohttp/helpers.py", line 721, in __exit__
raise asyncio.TimeoutError from None
asyncio.exceptions.TimeoutError
The text was updated successfully, but these errors were encountered:
Cephian
changed the title
Handle failed downloads better
Handle Exceptions when saving attachments
Apr 2, 2022
Running
!list
on spotty internet, the download can time out and give an unhandledTimeoutError
. We may even want to notify the user in Discord that some files failed to download when the list appearsInterestingly, Nextcord documentation claims that
Attachment.save()
will only raise eithernextcord.HttpException
ornextcord.NotFound
, so this might be case of lacking documentation on their part as well.The text was updated successfully, but these errors were encountered: