Add error handling to checkout page database queries
This commit is contained in:
@@ -2,7 +2,12 @@ import { getCurrentCustomer } from '@/lib/auth';
|
||||
import CheckoutPageClient from './client';
|
||||
|
||||
export default async function CheckoutPage() {
|
||||
const customer = await getCurrentCustomer();
|
||||
let customer = null;
|
||||
try {
|
||||
customer = await getCurrentCustomer();
|
||||
} catch (err) {
|
||||
console.error('Error fetching customer for checkout:', err);
|
||||
}
|
||||
|
||||
return <CheckoutPageClient isLoggedIn={!!customer} customer={customer} />;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user