testproxy: forward raw error body and headers from upstream#5263
Open
pietern wants to merge 1 commit into
Open
testproxy: forward raw error body and headers from upstream#5263pietern wants to merge 1 commit into
pietern wants to merge 1 commit into
Conversation
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
1 task
denik
approved these changes
May 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The reverse proxy in
libs/testproxyre-marshalledapierr.APIErrorinto a{error_code, message}envelope, droppingdetails[]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.DebugBytesverbatim with the original status code, so callers see exactly what the workspace sent. As a knock-on fix, response headers inincludeResponseHeaders(e.g.X-Databricks-Org-Id) are now also passed through on the error path — previously theWithResponseHeadervisitors weren't invoked whenapiClient.Doreturned an error.ResponseWrapperhas been populated on everyAPIErrorsince 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.