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

Log only to info on 402 errors from Stripe #874

Merged
merged 1 commit into from
Jun 18, 2019

Conversation

brandur
Copy link
Contributor

@brandur brandur commented Jun 18, 2019

As discussed in #869, breaks apart how Stripe errors are logged so that
status 402 errors go to info instead of error. This is meant to signal
that those errors are probably prompted by user data (as opposed to
sending invalid parameters or something), and handling them differently
allows integrations to avoid filling their error logs with messages that
they can't really prevent.

Fixes #869.

r? @ob-stripe
cc @stripe/api-libraries

As discussed in #869, breaks apart how Stripe errors are logged so that
status 402 errors go to info instead of error. This is meant to signal
that those errors are probably prompted by user data (as opposed to
sending invalid parameters or something), and handling them differently
allows integrations to avoid filling their error logs with messages that
they can't really prevent.

Fixes #869.
@brandur-stripe
Copy link
Contributor

Thanks OB!

@brandur-stripe brandur-stripe merged commit cc06098 into master Jun 18, 2019
@brandur-stripe brandur-stripe deleted the brandur-402-logging branch June 18, 2019 14:56
// comply to the letter of the specification and uses it in a broader
// sense.
if res.StatusCode == 402 {
s.LeveledLogger.Infof("User-compelled request error from Stripe: %v",

Choose a reason for hiding this comment

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

I find the wording here a bit confusing. Maybe a standard format could help, along the lines of:

“Stripe request GET /blah returned 402 User Error: Invalid Card Expiration”

With method, path, status, status text and error message being placeholders?

@mickeyreiss
Copy link

LGTM otherwise, solving the problem from the issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature request: Downgrade log level for card_errors
5 participants