I would also like to know if we can override the default prisma errors with our own, even if just for the sake of hiding data from the user-interface and giving them a more readable message.
03/14/2019, 3:23 AM
You can always wrap every DB call in try/catch, parse error and return a custom one.
I’m personally returning raw Prisma error to the front-end, but then parsing the error message and only showing the last part.
Prisma errors are normally long strings with many semicolons, so I just split by
and show the last two. I found that this is the most human-readable part of the error 😅