Repository navigation
feat: let the filter sanitize the error message - #184
Open
sean-regents wants to merge 1 commit into
Open
sean-regents wants to merge 1 commit into
sean-regents wants to merge 1 commit into
Conversation
ErrorTracker.Filter gains an optional sanitize_reason/1 callback. When the configured filter implements it, the error message is passed through it before it is saved, on both the error and the occurrence. An error saved before the callback existed takes the cleaned message at its next occurrence. The ignorer still receives the original message. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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 filter can clean the context before it is saved, but the error message (
reason) is saved as it is. Messages can carry user data, such as an email address in a changeset error or a value in a query error, and there is currently no way to clean them.This adds an optional
sanitize_reason/1callback toErrorTracker.Filter:reason, so the error row always shows the latest saved message.Tests in
test/error_tracker/filter_test.exscover a message saved unchanged without the callback, a message cleaned on both rows, and an older error cleaned when it happens again. The full suite succeeds withDB=sqlite mix test.The branch is based on v0.9.0. The three changed files are identical on main, so it merges cleanly.
馃 Generated with Claude Code