Skip to content

Commit 01a09ff

Browse files
authored
fix(app): stripe portal session stripe custome not found (#3435)
1 parent 4a759fc commit 01a09ff

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

openmeter/app/stripe/client/portal.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,11 @@ func (c *stripeAppClient) CreatePortalSession(ctx context.Context, input CreateP
8080
Locale: input.Locale,
8181
})
8282
if err != nil {
83+
// Stripe customer not found error
84+
if stripeErr, ok := err.(*stripe.Error); ok && stripeErr.Code == stripe.ErrorCodeResourceMissing {
85+
return PortalSession{}, NewStripeCustomerNotFoundError(input.StripeCustomerID)
86+
}
87+
8388
return PortalSession{}, c.providerError(err)
8489
}
8590

0 commit comments

Comments
 (0)