Skip to content

fix: 1243 returns both resetErr and the request's err on retries.Halt#1363

Open
pengux wants to merge 6 commits intodatabricks:mainfrom
pengux:feat/1243/return-request-and-reset-errors
Open

fix: 1243 returns both resetErr and the request's err on retries.Halt#1363
pengux wants to merge 6 commits intodatabricks:mainfrom
pengux:feat/1243/return-request-and-reset-errors

Conversation

@pengux
Copy link
Copy Markdown

@pengux pengux commented Dec 8, 2025

What changes are proposed in this pull request?

This fixes the issue with the request error being discarded when the request body is not able to be reset.

How is this tested?

Test are added to assert that both errors (resetErr and request's err) are wrapped in the returned error.

Fixes #1243

@pengux pengux changed the title feat: 1243 returns both resetErr and the request's err on retries.Halt fix: 1243 returns both resetErr and the request's err on retries.Halt Dec 10, 2025
@pengux pengux force-pushed the feat/1243/return-request-and-reset-errors branch from 094e65a to a3a7ead Compare December 10, 2025 09:32
@github-actions
Copy link
Copy Markdown

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 15 days if no further activity occurs. If this PR is still relevant, please leave a comment or push new changes to keep it open. Thank you for your contributions.

@github-actions github-actions bot added the stale The PR has been marked as "stale" and will automatically be closed if no further activity. label Mar 27, 2026
@pengux
Copy link
Copy Markdown
Author

pengux commented Mar 27, 2026

Still relevant

@renaudhartert-db
Copy link
Copy Markdown
Contributor

renaudhartert-db commented Mar 28, 2026

Hi @pengux, sorry for the late response on this.

The fix makes sense, the original request error should not be silently discarded when the body can't be reset. One small suggestion on the error message: I think the original request error should come first since that's the one the caller cares about, with the reset failure as secondary context:

fmt.Errorf("%w (unable to reset request body for retry: %w)", err, resetErr)

This way errors.Is matches the request error first, and the message reads more naturally.

The changelog entry also needs to follow the format used in NEXT_CHANGELOG.md -- it should be a bullet point with a short description, e.g.:

* Fixed request error being discarded when the request body cannot be reset for retry ([#1363](https://github.com/databricks/databricks-sdk-go/pull/1363)).

Let us know if you'd like to make these changes, or if you'd prefer we take the PR over from here and land it. Either way works for us.

@renaudhartert-db renaudhartert-db removed the stale The PR has been marked as "stale" and will automatically be closed if no further activity. label Mar 28, 2026
@pengux
Copy link
Copy Markdown
Author

pengux commented Mar 29, 2026

Hi @pengux, sorry for the late response on this.

The fix makes sense, the original request error should not be silently discarded when the body can't be reset. One small suggestion on the error message: I think the original request error should come first since that's the one the caller cares about, with the reset failure as secondary context:

fmt.Errorf("%w (unable to reset request body for retry: %w)", err, resetErr)

This way errors.Is matches the request error first, and the message reads more naturally.

The changelog entry also needs to follow the format used in NEXT_CHANGELOG.md -- it should be a bullet point with a short description, e.g.:

* Fixed request error being discarded when the request body cannot be reset for retry ([#1363](https://github.com/databricks/databricks-sdk-go/pull/1363)).

Let us know if you'd like to make these changes, or if you'd prefer we take the PR over from here and land it. Either way works for us.

@renaudhartert-db Thanks for reviewing, I've updated the PR according to your feedback now.

renaudhartert-db and others added 3 commits March 30, 2026 18:54
# Conflicts:
#	NEXT_CHANGELOG.md
#	httpclient/api_client.go
@renaudhartert-db renaudhartert-db force-pushed the feat/1243/return-request-and-reset-errors branch from 1d7cd36 to 80d15aa Compare March 30, 2026 18:59
@github-actions
Copy link
Copy Markdown

If integration tests don't run automatically, an authorized user can run them manually by following the instructions below:

Trigger:
go/deco-tests-run/sdk-go

Inputs:

  • PR number: 1363
  • Commit SHA: a9de7f68d28ce29a6f5bd534ed7a0149a9a60d84

Checks will be approved automatically on success.

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.

[ISSUE] API client reset error overwrites real root cause

2 participants