Skip to content

Populate the HTTPException body - #614

Open
afeld wants to merge 3 commits into
duckdb:mainfrom
afeld:copilot/fix-httpexception-body
Open

Populate the HTTPException body#614
afeld wants to merge 3 commits into
duckdb:mainfrom
afeld:copilot/fix-httpexception-body

Conversation

@afeld

@afeld afeld commented Sep 9, 2026

Copy link
Copy Markdown

I was trying to debug 404s and wasn't able to see the HTTP response body — it's always an empty string. I found the relevant code, then had Copilot make the fix. I tried running the test locally, but couldn't figure out how to build with httpfs. Hoping that CI shows it working. I haven't done C++ in 20 years, so open to any suggestions.

Here's Copilot's explanation of the change:


HTTPException.body could remain empty because Python exception mapping only read response_body from DuckDB error extra-info. Some HTTP errors now surface payload under body, so the attribute was silently unset.

  • Exception field mapping

    • Update HTTP exception translation to accept both extra-info keys:
      • legacy: response_body
      • current/alternate: body
    • This preserves backward compatibility while correctly populating HTTPException.body for newer payloads.
  • Test expectation alignment

    • Adjust HTTPFS exception assertion to validate body as a string instead of assuming it is always empty.
} else if (entry.first == "response_body" || entry.first == "body") {
    e.attr("body") = entry.second;
}

Copilot AI and others added 3 commits September 9, 2026 06:38
Co-authored-by: afeld <86842+afeld@users.noreply.github.com>
Co-authored-by: afeld <86842+afeld@users.noreply.github.com>
Co-authored-by: afeld <86842+afeld@users.noreply.github.com>
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.

2 participants