Skip to content

fix(errors): defensive map copies in WithFields/WithDetails; remove C…#19

Merged
KARTIKrocks merged 1 commit into
mainfrom
feat/errors-remove-too-many-requests-code
Apr 1, 2026
Merged

fix(errors): defensive map copies in WithFields/WithDetails; remove C…#19
KARTIKrocks merged 1 commit into
mainfrom
feat/errors-remove-too-many-requests-code

Conversation

@KARTIKrocks
Copy link
Copy Markdown
Owner

…odeTooManyRequests

Summary

Changed

  • errorsWithFields and WithDetails now copy the caller-supplied map before storing it, preventing external mutation of the error's internal state after the call

Removed

  • errorsCodeTooManyRequests constant and its codeStatusMap entry removed; rate-limit errors are owned by the middleware package

Fixed

  • errors — Added clarifying doc comment on (*Error).Is explaining that matching is code-based and symmetric between two *Error values with the same Code

Checklist

  • fmt, vet, lint, test, build passes (make all)
  • New code has tests where appropriate
  • Breaking changes are documented

@KARTIKrocks KARTIKrocks self-assigned this Apr 1, 2026
@KARTIKrocks KARTIKrocks merged commit d9cd51f into main Apr 1, 2026
9 checks passed
@KARTIKrocks KARTIKrocks deleted the feat/errors-remove-too-many-requests-code branch April 1, 2026 00:49
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.

1 participant