P
Prisma3d ago
Yoni

Error handling

From Docs: P2001 "The record searched for in the where condition ({model_name}.{argument_name} = {argument_value}) does not exist" this part of the documentation mentions that this error will be thrown when the record in the "where" clause is not found. I'm performing an update, however when the record is not found it just returns null without actually returning an error. I would expect the ORM to return error P2001... Any help would be greatly appreciated!
1 Reply
Yoni
Yoni3d ago
I stumbled upon findUniqueOrTHrow but calling await ... findUniqueOrThrow doesnt throw an error. Do i need to return its value for it to throw?
Want results from more Discord servers?
Add your server