Skip to content

Handle bad response on multipart bundle upload#816

Merged
nealrichardson merged 1 commit into
mainfrom
claude-issue-814
Jul 6, 2026
Merged

Handle bad response on multipart bundle upload#816
nealrichardson merged 1 commit into
mainfrom
claude-issue-814

Conversation

@nealrichardson

Copy link
Copy Markdown
Contributor

Fixes #814.

Problem

In RSConnectClient.upload_bundle (rsconnect/api.py), the multipart form branch (used when metadata is provided) never called handle_bad_response. Only the plain-tarball branch did. As a result, a bad HTTP response on a metadata upload propagated as a raw HTTPResponse object rather than raising an RSConnectException, leading to cryptic failures downstream.

Fix

Moved the single handle_bad_response call out of the else branch so it runs for both upload paths before returning.

Test

Added test_upload_bundle_with_metadata_handles_bad_response, which patches post to return a failed HTTPResponse on the metadata path and asserts a clean RSConnectException is raised.

🤖 Generated with Claude Code

The multipart form path in upload_bundle (used when metadata is provided)
never called handle_bad_response, so a bad HTTP response propagated as a
raw HTTPResponse and caused cryptic downstream failures. Call it for both
upload paths.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-07-06 17:49 UTC

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
7607 6323 83% 0% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
rsconnect/api.py 81% 🟢
TOTAL 81% 🟢

updated for commit: eb55d13 by action🐍

@nealrichardson nealrichardson requested a review from marcosnav July 6, 2026 16:10
@nealrichardson nealrichardson merged commit 0399fa9 into main Jul 6, 2026
22 checks passed
@nealrichardson nealrichardson deleted the claude-issue-814 branch July 6, 2026 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Multipart bundle upload with metadata doesn't handle bad response

2 participants