mirror of
https://github.com/vercel/commerce.git
synced 2025-07-25 11:11:24 +00:00
Better error handling. (#1150)
This commit is contained in:
@@ -19,8 +19,8 @@ export default function DeleteItemButton({ item }: { item: CartItem }) {
|
||||
const error = await removeItem(item.id);
|
||||
|
||||
if (error) {
|
||||
alert(error);
|
||||
return;
|
||||
// Trigger the error boundary in the root error.js
|
||||
throw new Error(error.toString());
|
||||
}
|
||||
|
||||
router.refresh();
|
||||
|
Reference in New Issue
Block a user