prisma-appsync
prisma-appsync copied to clipboard
Improve Error Handling
Right now, displaying and handling errors can be a bit confusing. I'm not sure if there is a best practice for this case but even with a unique constraint failure it can throw a lot of text.

The current Lambda Function provided is supposed to treat errors in two ways:
- What is returned to the Client doing the API call is intended to be a “public-facing” error (generic message, stripped out from details that could lead to security issues).
- On the other end, the “developer-facing“ error (what you are seeing in the AppSync console) is displaying full details for logging in CloudWatch. But you are right in saying that the developer-facing one could probably be improved. I never really looked into it, but there are few Prisma guides dedicated to error handling: https://www.prisma.io/docs/reference/api-reference/error-reference/ https://www.prisma.io/docs/concepts/components/prisma-client/handling-exceptions-and-errors https://www.prisma.io/docs/reference/api-reference/prisma-client-reference#error-formats I’ll add this issue to the roadmap so that we can properly look into it.