Skip to content

Send SDK errors to zerolog and let callers downgrade handled errors - #17

Merged
jamielinux merged 1 commit into
mainfrom
jnguyen/sdk-errors
Sep 1, 2026
Merged

jamielinux merged 1 commit into
mainfrom
jnguyen/sdk-errors

Conversation

@jamielinux

Copy link
Copy Markdown
Member

stripe-go logs its own errors before returning them, so a missing coupon we already handle still showed up as an ERROR. In this commit, SDK errors now go through zerolog and callers can decide which errors get downgraded to warn. Also added the Stripe error to the coupon log line, so the SDK error becomes truly redundant.

We already dropped SDK Debug/Info/Warn before, and that remains the case now but it's still possible to surface them by changing stripe.DefaultLeveledLogger.

stripe-go logs its own errors before returning them, so a missing coupon
we already handle still showed up as an `ERROR`. In this commit, SDK
errors now go through zerolog and callers can decide which errors get
downgraded to warn. Also added the Stripe error to the coupon log line,
so the SDK error becomes truly redundant.

We already dropped SDK Debug/Info/Warn before, and that remains the case
now but it's still possible to surface them by changing
`stripe.DefaultLeveledLogger`.
@jamielinux jamielinux self-assigned this Sep 1, 2026

@mikemherron mikemherron left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM :)

@jamielinux
jamielinux merged commit b432cf4 into main Sep 1, 2026
2 checks passed
@jamielinux
jamielinux deleted the jnguyen/sdk-errors branch September 1, 2026 08:41
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