Conversation
WithAcceptedErrors has been storing into opts.isErrorAccepted, a field that is never read — making the option silently inert. Remove the dead field and make WithAcceptedErrors an explicit no-op, updating its deprecation notice to reflect this. Align the errRejected switch case in WithAdaptiveThrottle to use the same unwrap-then-fallthrough pattern already used in Throttle and Throttle[T], removing a structural inconsistency with identical observable behaviour. Fix a typo in the DefaultAcceptedErrors deprecation comment: DefaultRejectedErrors → IsRejectedErro
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.
Summary
Dead code removed:
adaptiveThrottleOptions.isErrorAcceptedwasset by
WithAcceptedErrorsbut never transferred to the struct orconsulted anywhere. Callers using this deprecated option got silently
no-op behaviour. The field is removed;
WithAcceptedErrorsis now anexplicit no-op with an updated deprecation notice.
Consistent
errRejectedhandling:WithAdaptiveThrottlewasrejecting before unwrapping the error, while
ThrottleandThrottle[T]unwrap first and then fall through to the reject step.WithAdaptiveThrottlenow uses the same pattern. No behaviour change.Doc typo fix:
DefaultRejectedErrors(non-existent) corrected toIsRejectedErrorin theDefaultAcceptedErrorsdeprecation comment.Note
Low Risk
Low risk: mainly removes unused/dead option plumbing and makes
errRejectedhandling consistent; throttling behavior should remain unchanged except for clearer deprecation/no-op behavior.Overview
Removes dead configuration around
AdaptiveThrottleOptionby dropping the unusedisErrorAcceptedfield and making the deprecatedWithAcceptedErrorsan explicit no-op with updated deprecation guidance.Aligns
WithAdaptiveThrottle’s error classification withThrottle/Throttle[T]by unwrappingerrRejectedand then falling through to the standardIsRejectedErrorrejection path, and fixes a deprecation comment typo to referenceIsRejectedError.Written by Cursor Bugbot for commit 32160c4. This will update automatically on new commits. Configure here.