Prisma 7 + Neon Adapter: Unique Constraint Errors Not Throwing P2002
Hey! I'm using Prisma 7+ with the Neon serverless adapter, and I'm trying to properly handle unique constraint violations.
With regular Prisma, I would normally catch this using:
However, when running with Neon, I’m not getting a P2002 error at all.
Instead, Prisma throws a DriverAdapterError that looks like this:
Is there a more stable or official method for extracting the unique field name when using Prisma + Neon?
Any guidance or best practices would be appreciated! Thank you!
With regular Prisma, I would normally catch this using:
However, when running with Neon, I’m not getting a P2002 error at all.
Instead, Prisma throws a DriverAdapterError that looks like this:
Is there a more stable or official method for extracting the unique field name when using Prisma + Neon?
Any guidance or best practices would be appreciated! Thank you!