New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unique constraint error inside a transaction throws unparsed error (but works fine when using Node API) #7326
Comments
I can reproduce this. Looks like we aren't serializing the error properly for child process + http version and it is properly serialized in the NAPI implementation. We should fix this as NAPI is not stable yet. |
For internal reference: Error thrown with child process + http bridge implementation:
Error thrown with the NAPI implementation:
Notice the proper stack trace rather than the engine panic dump. |
Just to clarify because it took me a couple reads.
|
Could this be related to: #6705? |
I would favour a breaking change in the http protocol vs a keeping a broken implementation around. |
Bug description
While trying to auto-generate slugs for user-made pages at Copyfolio, we noticed that unique constraint violation errors aren’t caught properly inside a
prisma.$transaction
.How to reproduce
Have a model with a unique constraint, e.g. a
Site
with a globally unique URLslug
.Run some code which is meant to detect unique
slug
constraint violation errors – and then auto-generate a new slug to try with, but that isn’t part of the code below:It should throw an unknown error, which isn’t the expected behavior. However, then using
previewFeatures = ["nApi"]
, the code above works as expected.Expected behavior
No response
Prisma information
Environment & setup
Prisma Version
The text was updated successfully, but these errors were encountered: