-
Notifications
You must be signed in to change notification settings - Fork 212
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
feat(shared): SanitizeExceptions decorator #18164
Conversation
78189bd
to
b78e802
Compare
32cb293
to
b6653fc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good so far. Just left some inline comments in a few spots.
nit. could you fix up the git commit body to match fxa contributors guidelines?
7c34fca
to
87a366c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly just a few questions left. But otherwise this looks good.
b373c3c
to
bc2ea71
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
bc2ea71
to
749a2b9
Compare
Because: * In instances where the client can call methods "directly" (such as via NextJS Server Actions), we need to ensure that the only data that gets passed through to the user is what is intended. Error propagation is a common way for unexpected data to leak to the user. This commit: * Adds a SanitizeExceptions decorator to libs/shared/error that wraps a class, and captures any errors thrown by its methods. Unless specified, errors are replaced with a generic error message. Original error data is sent to Sentry, along with a data tag to indicate whether it was sanitized or passed through. Closes # FXA-10626
749a2b9
to
db54463
Compare
Because
This pull request
Issue that this pull request solves
Closes: FXA-10626
Checklist
Put an
x
in the boxes that apply