diff --git a/lib/constants.py b/lib/constants.py index 150ca13..3c61920 100644 --- a/lib/constants.py +++ b/lib/constants.py @@ -24,7 +24,8 @@ RBX_PACKAGE_ID_PROPERTY_NAME = "Roblox Package ID" ASSET_DESCRIPTION = "Uploaded from Blender" ERROR_MESSAGES = { - "TIMED_OUT": "Timed Out", + "UPLOAD_TIMED_OUT": "Upload Timed Out", + "OPERATION_TIMED_OUT": "Operation Timed Out", "INVALID_RESPONSE": "Invalid Response", "ADD_ON_ERROR": "Add-on Error", } diff --git a/lib/upload_operator.py b/lib/upload_operator.py index 2bf85e9..82465ea 100644 --- a/lib/upload_operator.py +++ b/lib/upload_operator.py @@ -237,6 +237,7 @@ def upload_task_complete(task, window_manager, area, target_object, temporary_di property and cleaning up from the operation.""" from . import status_indicators, constants import openapi_client + import asyncio try: operation = task.result() @@ -248,7 +249,7 @@ def upload_task_complete(task, window_manager, area, target_object, temporary_di elif not operation.done: # Timeout while polling for upload job to finish. It may yet finish or fail, but we stopped checking. status_indicators.set_status( - window_manager, area, target_object, constants.ERROR_MESSAGES["TIMED_OUT"], "ERROR" + window_manager, area, target_object, constants.ERROR_MESSAGES["OPERATION_TIMED_OUT"], "ERROR" ) elif operation.response: # Success @@ -266,7 +267,11 @@ def upload_task_complete(task, window_manager, area, target_object, temporary_di window_manager, area, target_object, constants.ERROR_MESSAGES["INVALID_RESPONSE"], "ERROR" ) print(f"Upload failed, invalid response:\n{operation}") - + except asyncio.exceptions.TimeoutError as exception: + # Timeout while waiting for initial upload to return an operation ID. It may yet finish or fail, but we stopped waiting. + status_indicators.set_status( + window_manager, area, target_object, constants.ERROR_MESSAGES["UPLOAD_TIMED_OUT"], "ERROR" + ) except openapi_client.rest.ApiException as exception: traceback.print_exception(exception) from .extract_exception_message import extract_exception_message