Skip to content

⚠️ Throw an error when using the wrong webhook parsing method#1767

Merged
xavdid-stripe merged 3 commits intomasterfrom
DEVSDK-3032
Mar 24, 2026
Merged

⚠️ Throw an error when using the wrong webhook parsing method#1767
xavdid-stripe merged 3 commits intomasterfrom
DEVSDK-3032

Conversation

@xavdid-stripe
Copy link
Member

Why?

When users call the wrong webhook parsing method, the call usually works, but happily gives them a malformed object for their troubles. Rather than fail silently, we should fail loudly and help direct users to the correct method.

What?

  • throw error in each of constructWebhook and parseEventNotification if it's received the wrong type, pointing the user to the other method
  • add tests
  • adjust existing tests which used the wrong object type

See Also

@xavdid-stripe xavdid-stripe requested a review from a team as a code owner March 19, 2026 23:44
@xavdid-stripe xavdid-stripe requested review from mbroshi-stripe and removed request for a team March 19, 2026 23:44
@xavdid-stripe xavdid-stripe enabled auto-merge (squash) March 19, 2026 23:44
@xavdid-stripe xavdid-stripe requested review from jar-stripe and removed request for mbroshi-stripe March 20, 2026 00:01
@xavdid-stripe xavdid-stripe merged commit 18f4f88 into master Mar 24, 2026
16 checks passed
@xavdid-stripe xavdid-stripe deleted the DEVSDK-3032 branch March 24, 2026 18:42
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