Skip to content

testproxy: forward raw error body and headers from upstream#5263

Open
pietern wants to merge 1 commit into
mainfrom
testserver-proxy-fix
Open

testproxy: forward raw error body and headers from upstream#5263
pietern wants to merge 1 commit into
mainfrom
testserver-proxy-fix

Conversation

@pietern
Copy link
Copy Markdown
Contributor

@pietern pietern commented May 18, 2026

The reverse proxy in libs/testproxy re-marshalled apierr.APIError into a {error_code, message} envelope, dropping details[] and any other fields the workspace returned. As a result, acceptance tests run against the cloud could not observe error metadata that real CLI/TF invocations rely on.

This change forwards apiErr.ResponseWrapper.DebugBytes verbatim with the original status code, so callers see exactly what the workspace sent. As a knock-on fix, response headers in includeResponseHeaders (e.g. X-Databricks-Org-Id) are now also passed through on the error path — previously the WithResponseHeader visitors weren't invoked when apiClient.Do returned an error.

ResponseWrapper has been populated on every APIError since databricks-sdk-go#1261 (v0.100.0); the CLI is on v0.132.0. A panic guards the invariant in case the SDK ever changes shape.

The reverse proxy in libs/testproxy re-marshalled apierr.APIError into a
{error_code, message} envelope, dropping details[] and any other fields
the workspace returned. As a result, acceptance tests run against the
cloud could not observe error metadata that real CLI/TF invocations rely
on.

Forward apiErr.ResponseWrapper.DebugBytes verbatim with the original
status code so callers see exactly what the workspace sent. Also pass
through response headers in includeResponseHeaders on the error path;
WithResponseHeader visitors are not invoked when apiClient.Do returns
an error.

ResponseWrapper has been populated on every APIError since
databricks/databricks-sdk-go#1261 (v0.100.0); the CLI is on v0.132.0.
A panic guards the invariant in case the SDK ever changes shape.

Co-authored-by: Isaac
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