Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix RedactableError not satisfying the Redactor interface #6253

Merged
merged 1 commit into from
May 17, 2023

Conversation

bbrks
Copy link
Member

@bbrks bbrks commented May 17, 2023

  • Add String() method to RedactableError to allow it to satisfy Redactor again.
  • Add compile-time interface checks to type to catch future regressions.

Integration Tests

_ error = &RedactableError{}
_ Redactor = &RedactableError{}
)

// Create a new redactable error. Same signature as fmt.Errorf() for easy drop-in replacement.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code seems fine, although you can't use %w which is always tempting to use around errors, I'd drop a comment. If you wrap this error, I also think the redaction stops working so I worry about this use.

This code is unused though so I wonder if it's worth keeping around?

Copy link
Member Author

@bbrks bbrks May 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • I agree, this type predated %w - we should figure out what to do about that when we have time. CBG-2997
  • RedactableError is used ... ?

Screenshot_20230517_142811

@bbrks bbrks merged commit c1cf34e into master May 17, 2023
@bbrks bbrks deleted the fix_RedactableError branch May 17, 2023 13:46
torcolvin pushed a commit that referenced this pull request Oct 6, 2023
* [3.1.2 Backport] Fix RedactableError not satisfying the Redactor interface (#6253)

* [3.1.2 Backport] CBG-3497: Make `RedactableError` compatible with `%w`
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.

2 participants