No PrismaClientKnownRequestError when unique constraint fails in transaction #7786
Labels
bug/2-confirmed
Bug has been reproduced and confirmed.
kind/bug
A reported bug.
team/client
Issue for team Client.
topic: error
topic: transaction
Milestone
Bug description
If you attempt to insert a row while in a transaction and a unique constraint fails, the error sent is:
If not in a transaction, error is a PrismaClientKnownRequestError with code P2002
How to reproduce
Without transaction
Error:
With transaction
Error:
Expected behavior
Even in the transaction, Error should be a PrismaClientKnownRequestError with a code P2002
Prisma information
Environment & setup
Prisma Version
The text was updated successfully, but these errors were encountered: