Bad error messages with array of transactions
I'm concatenating my transactions like this
My payload looks like this
But my error looks like this (it will be the first comment...my post was too long apparently)
The import part is that last line there "unknown argument 'unknownProperty'" Great!
... "prisma.systems.upsert" wait what. No. That error is actually on prisma.equipmentPhotos.upsert
Prisma appears to be taking the first element in the array of transactions and attributing the error to that when the actual error is somewhere else.
Is this a bug with prisma or should I be handling my transaction differently?
5 Replies
Actual prisma error
Hi @Ortharion 👋
Can you please share your schema and is it possible to use this approach for your your transaction to see if the error persist?
Transactions and batch queries (Reference) | Prisma Documentation
This page explains the transactions API of Prisma Client.
Apologies, I thought I was doing that approach?
Oh I didn't put the actual line of the transaction.
And the schema isn't super important here. I intentionally put a bad property to force the error. Getting an error isn't the issue, it's when we have errors, prisma is NOT bubbling the correct information.
I'm pretty sure this is a bug report and not a request for help. But I wanted to make sure I didn't miss something in the docs somewhere about how to properly manage errors when using an array of prisma promises in a $transaction
Sure. Thanks