fix: retain safe background error codes - #33
Merged
Merged
Conversation
Collaborator
|
Security review — no issues found (reviewed head
CI hasn't run on this PR yet; this should merge after #19 once it's green. |
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.
What changed
Follow-up to the maintainer note on #19:
backgroundFailure()currently keeps onlyError.name, so PostgreSQL failover errors can collapse to an unhelpfulerror: "error".Retain a sanitized string
codewhen it contains only a short identifier-safe value. This preserves SQLSTATE values such as57P01and common runtime codes such asECONNRESETwithout logging error messages, provider payloads, URLs, or arbitrary code strings.The regression verifies that:
This is independent of #19 and simply makes the existing centralized background logger more diagnostic.
Verification
mainat82ff35b.Integration limits
No provider/database integration run; this only changes structured background error logging.
AI-use note: I used an AI assistant to inspect the logging path, draft the sanitizer and regression, and review the final diff. I verified that no error message or payload is added to the log output before opening this PR.