vercel / nextjs-subscription-payments

Clone, deploy, and fully customize a SaaS subscription application with Next.js.
https://subscription-payments.vercel.app/
MIT License
5.79k stars 1.19k forks source link

Fix error logging in admin.ts #302

Closed Hahlh closed 4 months ago

Hahlh commented 4 months ago

It seems to errors would either need to be JSON.stringified or their messages accessed for proper error logging.

Currently the output is: Error: Product insert/update failed: [object Object]

I assumed that all errors here are uniform in their structure (I didn't do any further testing with other errors) and that accessing the message might be preferable, although the loss of the error code might be a big downside:

Error: Price insert/update failed: {
  "code": "PGRST301",
  "details": null,
  "hint": null,
  "message": "JWSError JWSInvalidSignature"
}

I just started with Supabase, therefore this PR can be seen as a slightly more detailed issue. Feel free to edit it however you see fit without any further communication.

vercel[bot] commented 4 months ago

@Hahlh is attempting to deploy a commit to the Vercel Solutions Team on Vercel.

A member of the Team first needs to authorize it.