sadmann7 / skateshop

An open source e-commerce skateshop build with everything new in Next.js.
https://skateshop.sadmn.com
MIT License
5.07k stars 730 forks source link

Adding a new product with the same [name] throws a different error than expected #108

Open ChoaibMouhrach opened 6 months ago

ChoaibMouhrach commented 6 months ago

When attempting to insert a product with a name that already exists, the error message displayed in the toast is:

An error occurred in the Server Components render. The specific message is omitted in production builds to avoid leaking sensitive details. A digest property is included on this error instance, which may provide additional details about the nature of the error.

Instead, the more user-friendly message should be:

Product name is already in use.

Arkyapatwa commented 5 months ago

Does this happen when we are selling a product and adding the same product for sale?

ChoaibMouhrach commented 5 months ago

I'm not sure, but throwing errors inside a server action in production is not the same in dev mode