Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better error message for upload timeouts #29

Merged
merged 2 commits into from
Oct 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
}
Expand Down
9 changes: 7 additions & 2 deletions lib/upload_operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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
Expand All @@ -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
Expand Down
Loading