-
-
Notifications
You must be signed in to change notification settings - Fork 61
Open
Description
In case when space is not enough on the server side the stream.write operation fails with ConnectionResetError.
msg is like that 'Connection lost', and that's it, nothing is useful at all:
from aioftp import Client
async def main():
client = Client()
await client.connect(
'0.0.0.0',
port=21,
)
await client.login(
user='',
password='*',
)
try:
stream = await client.upload_stream('test.txt', offset=0)
await stream.write(b'data' * 1000)
except ConnectionResetError:
prepare_next_try()Is there way to recognize that the problem is related to the shortage of volume rather than network issue?
If there is, then it would be helpful to make a stop of uploading instead of keep trying to reconnect endlessly.
Here is an example which shows something similar i suppose to have:
try:
stream = await client.upload_stream('test.txt', offset=0)
await stream.write(b'data' * 1000)
except ConnectionResetError:
prepare_next_try()
except NoSpaceError:
stop_uploading()Metadata
Metadata
Assignees
Labels
No labels