Skip to content

Commit

Permalink
chore(console): Handle error for subscription-less customers graceful…
Browse files Browse the repository at this point in the history
…ly (#2677)
  • Loading branch information
Cosmin-Parvulescu authored Sep 12, 2023
1 parent c4f0c36 commit 3d169ec
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion apps/console/app/utils/billing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,11 @@ export const getCurrentAndUpcomingInvoices = async (
},
])
} catch (er) {
console.error(er)
if ((er as Stripe.errors.StripeError).code === 'invoice_upcoming_none') {
console.info(`No upcoming invoices for customer ${spd.customerID}`)
} else {
throw er
}
}
}
return invoices
Expand Down

0 comments on commit 3d169ec

Please sign in to comment.