prisma-engines
prisma-engines copied to clipboard
Extra error details for query engine errors
Adds a list of errors to the query engine dmmf. Adds a new key in the json response for errors that contains more error details. For example:
{
"name": "UniqueKeyViolation",
"code": "P2002",
"fields": {
"constraint": {
"fields": ["email", "name"]
}
}
}
Ticket for this https://github.com/prisma/prisma/issues/5040
A few things to note:
- I've split up the
user-facing-error-macro
intouser-facing-error-macro
anduser-facing-error-parsing
. I did this because you cannot export functions from aproc-macro
crate. And I want to reuse the functions that create the UserError. - There is a build.rs file in the
user-facing-errrors
, it uses theuser-facing-error-parsing
library to read through all the error files and generate a list of errors that are added to the dmmf.