prisma-appsync icon indicating copy to clipboard operation
prisma-appsync copied to clipboard

Improve Error Handling

Open DregondRahl opened this issue 4 years ago • 1 comments

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.

recording

DregondRahl avatar Jun 28 '21 15:06 DregondRahl

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.

maoosi avatar Jun 29 '21 07:06 maoosi