diff --git a/updater.py b/updater.py index 311b886..2180fb8 100644 --- a/updater.py +++ b/updater.py @@ -327,7 +327,15 @@ if __name__ == "__main__": with open(local_path, 'rb') as f: ftp.storbinary(f'STOR {remote_path}', f, 8192, callback=progress_callback) print(f"\nUploaded {file} to {selected_ip}.") + except ftplib.all_errors as e: + print(f"FTP error: {e}") + + try: ftp.sendcmd("BYE") print(f"Disconnected from {selected_ip}.") except ftplib.all_errors as e: - print(f"FTP error: {e}") + if str(e).strip().lower() == "timed out": + # Suppress expected timeout after BYE + print(f"Disconnected from {selected_ip}.") + else: + print(f"FTP error after BYE: {e}")