Skip to content

Commit 34e1897

Browse files
authored
fix(files): report the status code when ingest-file fails (#225)
## Summary - `FileClient.upload` now returns `Failed to complete file upload: <status>` when the ingest step fails, matching the upload-URL failure (`Failed to get upload URL: <status>`). - Without the code, a caller cannot tell a rate-limited ingest (429) from any other failure, so it cannot back off and retry. Seen in production: a five-table load was refused at `ingest-file`, and the caller's 429 retry never fired. ## Tier Stable tier (`FileClient` facade): only the error string changes, adding the status after the existing prefix. Callers that check `"Failed to complete file upload" in error` keep matching. Patch release. ## Test plan - [x] `just test-all`: 595 passed, 17 skipped; lint, format and typecheck clean - [x] `test_upload_update_fails` now asserts the exact message, including the status 🤖 Generated with [Claude Code](https://claude.com/claude-code)
2 parents 464eaca + 693df54 commit 34e1897

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

‎robosystems_client/clients/file_client.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ def upload(
239239
table_name=table_name,
240240
file_name=file_name,
241241
success=False,
242-
error="Failed to complete file upload",
242+
error=f"Failed to complete file upload: {update_response.status_code}",
243243
)
244244

245245
# Extract staging metadata from the operation envelope result. Large files

‎tests/test_file_client.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ def test_upload_status_update_failure(
236236
result = client.upload(graph_id, "Entity", BytesIO(b"data"))
237237

238238
assert result.success is False
239-
assert "Failed to complete file upload" in result.error
239+
assert result.error == "Failed to complete file upload: 500"
240240

241241
def test_upload_no_token(self, mock_config, graph_id):
242242
"""Test upload fails without API key."""

0 commit comments

Comments
 (0)