Invalid error message when using transactions
We have a sync endpoint for our mobile app (it's offline capable first). The endpoint is entirely transaction based. So we iterate through the changes and build up an array of prisma queries and then wrap all those in a prismaClient.$transaction(transactions).
This is all wrapped in a try catch, but the issue is when something breaks, we seem to be getting erroneous error messages out of prisma. As in completely false error messages. It will say something like "can't find userId. Did you mean user?" Except the data being pushed to the user schema doesn't contain any invalid properties and userId is a valid property on the user schema. It's typically one of the other transactions that had an error.
Any thoughts on why it's giving erroneous errors?
2 Replies